diff options
| author | Jeff Carr <[email protected]> | 2025-10-07 00:35:37 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-07 00:35:37 -0500 |
| commit | d94113ae104ad5d79302e74a11f5a309a82e34de (patch) | |
| tree | cfb751019f0f3c7c3b60c7e7a5f15464668c8932 /save.go | |
| parent | b695089179b9003375a8c51ce45efeaffcc2e816 (diff) | |
send errors. also, check 'Filename' and 'filename'
Diffstat (limited to 'save.go')
| -rw-r--r-- | save.go | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -20,9 +20,9 @@ func ConfigSave(pb proto.Message) error { } func Save(pb proto.Message) error { - fullname, ok := GetFilename(pb) - if !ok { - return ErrProtoFilename + fullname, err := GetFilename(pb) + if err != nil { + return err } if strings.HasSuffix(fullname, ".pb") { SavePB(pb, fullname) @@ -82,9 +82,9 @@ func ConfigSaveWithHeader(pb proto.Message, header string) error { func saveTEXT(pb proto.Message, header string) error { // get pb.Filename if it is there in the .proto file - fullname, ok := GetFilename(pb) - if !ok { - return ErrProtoFilename + fullname, err := GetFilename(pb) + if err != nil { + return err } if !strings.HasSuffix(fullname, ".text") { // todo: append .text here? @@ -107,9 +107,9 @@ func saveTEXT(pb proto.Message, header string) error { func saveJSON(pb proto.Message) error { // get pb.Filename if it is there in the .proto file - fullname, ok := GetFilename(pb) - if !ok { - return ErrProtoFilename + fullname, err := GetFilename(pb) + if err != nil { + return err } if !strings.HasSuffix(fullname, ".text") { // todo: append .text here? |
