We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dab7df1 commit e0f4a8bCopy full SHA for e0f4a8b
internal/nix/nix.go
@@ -121,7 +121,12 @@ func ExperimentalFlags() []string {
121
// TODO: rename to System
122
func MustGetSystem() string {
123
if cachedSystem == "" {
124
- panic("MustGetSystem called before being initialized by System")
+ // For internal calls (during tests), this may not be initialized properly
125
+ // so do a best-effort attempt to initialize it.
126
+ _, err := System()
127
+ if err != nil {
128
+ panic("MustGetSystem called before being initialized by System")
129
+ }
130
}
131
return cachedSystem
132
0 commit comments