tozny/utils-go

panic: Failed to find environment variable with identifier: FACILITY_VALUE

Closed this issue · 2 comments

Update it from github.com/tozny/utils-go v0.0.58 to github.com/tozny/utils-go v0.0.61, it reports err:
panic: Failed to find environment variable with identifier: FACILITY_VALUE

goroutine 1 [running]:
github.com/tozny/utils-go.MustGetenv({0x11a38ba, 0xe})
/xx/go/pkg/mod/github.com/tozny/utils-go@v0.0.61/os.go:13 +0x16d
github.com/tozny/utils-go/logging.init()
/xx/go/pkg/mod/github.com/tozny/utils-go@v0.0.61/logging/syslog_format._logging.go:108 +0xc78

It caused by the commit: 0e7c6ae

It added a static initializer for:

var Facility = FacilityPriority(utils.MustGetenv("FACILITY_VALUE"))

I am assuming this is probably set by the server code, but this library is pulled in implicitly for the client libraries as well which is not setting the variable and causing the linked applications to crash as a result.

This has been fixed in the latest version