diff options
| author | Jeff Carr <[email protected]> | 2025-10-20 13:20:40 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-20 13:20:40 -0500 |
| commit | 5c4c1fcaf4e724573dd39b4d4fa0d600a9870221 (patch) | |
| tree | c50e35d812e30029a40132c7653504b79a0c3c9b /loadRaw.go | |
| parent | c99d5193053a9377acfb62677bf241e540f9f6ee (diff) | |
maybe better than before. notsure
Diffstat (limited to 'loadRaw.go')
| -rw-r--r-- | loadRaw.go | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -31,7 +31,7 @@ var ErrMarshal error = fmt.Errorf("protobuf parse error") // - error on read func ConfigLoadRaw(pb proto.Message, appname string, protoname string) error { // Get ~/.config/appname/protoname.text - fullname := GetConfigFilename(appname, protoname) + fullname := makeConfigFilename(appname, protoname) var pbFilenameSupport bool var err error @@ -77,18 +77,6 @@ func ConfigLoadRaw(pb proto.Message, appname string, protoname string) error { return ErrMarshal } -// returns the default constructed filename: -// ~/.config/appname/protoname.text -func GetConfigFilename(appname string, protoname string) string { - var err error - configDir, err := os.UserConfigDir() - if err != nil { - // todo: get something better than /tmp/ if anyone cares - return filepath.Join("/tmp", appname, protoname+".text") - } - return filepath.Join(configDir, appname, protoname+".text") -} - // loads from the users .cache dir // if the .proto file version changes, automatically delete the .pb // file. This is important to avoid marshalling garbage data |
