summaryrefslogtreecommitdiff
path: root/load.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-10-17 03:42:03 -0500
committerJeff Carr <[email protected]>2025-10-17 03:42:03 -0500
commitb2887028424d7034dd46370be0f60d5e1fa4a13d (patch)
treed456fa9b11930c0120f38d44cc7b7af94f076743 /load.go
parent5579498720c5c1e0cdf31f97f7ad31dfe9dbf0aa (diff)
really dumbv0.0.27
Diffstat (limited to 'load.go')
-rw-r--r--load.go28
1 files changed, 5 insertions, 23 deletions
diff --git a/load.go b/load.go
index fc9a5a0..e1e95d6 100644
--- a/load.go
+++ b/load.go
@@ -36,30 +36,10 @@ func ConfigLoad(pb proto.Message, appname string, protoname string) error {
var pbFilenameSupport bool
var err error
curfilename, err := GetFilename(pb)
- if err != nil {
- log.Info("This protobuf doesn't support pb.Filename")
- // make note this protobuf doesn't support Filenames
- } else {
+ if err == nil {
pbFilenameSupport = true
- }
- // panic(curfilename)
-
- // potential syntax with this GO library is starting to look like:
- //
- // if errors.Is(err, config.ErrEmpty)
- //
- // if errors.Is(err, config.VersionMismatch)
- //
- // if both don't exist or both are empty, return known errors
- // these can be used to detect if the user is new to the application
- if err := missingConfig(fullname); err != nil {
- if errors.Is(err, os.ErrNotExist) {
- return os.ErrNotExist
- }
- if errors.Is(err, ErrEmpty) {
- return ErrEmpty
- }
- return err
+ } else {
+ // this .proto doesn't have the Filename variable/message
}
if err = loadTEXT(pb, fullname); err == nil {
@@ -322,6 +302,7 @@ func loadJSON(pb proto.Message, fullname string) error {
return nil
}
+/* left this here to remind myself just how dumb I can be
// dumb but simple to read logic
func missingConfig(fullname string) error {
data1, err1 := os.ReadFile(fullname)
@@ -341,6 +322,7 @@ func missingConfig(fullname string) error {
}
return nil
}
+*/
func loadFile(fullname string) ([]byte, error) {
data, err := os.ReadFile(fullname)