private/apigen: Add comment about panics

Add a comment in 2 methods about they panic as it's specified for the
`MustWriteDocs`.

Change-Id: I15d5fa420af37318d828bc633bed62988f8b207b
This commit is contained in:
Ivan Fraixedes 2023-08-23 20:10:05 +02:00 committed by Storj Robot
parent 95a5cfe647
commit b0d072270b
2 changed files with 2 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import (
const DateFormat = "2006-01-02T15:04:05.999Z" const DateFormat = "2006-01-02T15:04:05.999Z"
// MustWriteGo writes generated Go code into a file. // MustWriteGo writes generated Go code into a file.
// If an error occurs, it panics.
func (a *API) MustWriteGo(path string) { func (a *API) MustWriteGo(path string) {
generated, err := a.generateGo() generated, err := a.generateGo()
if err != nil { if err != nil {

View File

@ -13,6 +13,7 @@ import (
) )
// MustWriteTS writes generated TypeScript code into a file. // MustWriteTS writes generated TypeScript code into a file.
// If an error occurs, it panics.
func (a *API) MustWriteTS(path string) { func (a *API) MustWriteTS(path string) {
f := newTSGenFile(path, a) f := newTSGenFile(path, a)