mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
Run the init() function for all kernel packages and their dependencies
Things like error messages (e.g in the io pkg) are actually allocated when init() is executed. Unless we trigger a call to init(), values like this will be nil causing various problems when we try to use functions from the stdlib.
This commit is contained in:
parent
a1d65d4c09
commit
dc37e86421
@ -266,6 +266,7 @@ func TestInit(t *testing.T) {
|
||||
modulesInitFn = modulesInit
|
||||
typeLinksInitFn = typeLinksInit
|
||||
itabsInitFn = itabsInit
|
||||
initGoPackagesFn = initGoPackages
|
||||
}()
|
||||
|
||||
mallocInitFn = func() {}
|
||||
@ -273,6 +274,7 @@ func TestInit(t *testing.T) {
|
||||
modulesInitFn = func() {}
|
||||
typeLinksInitFn = func() {}
|
||||
itabsInitFn = func() {}
|
||||
initGoPackagesFn = func() {}
|
||||
|
||||
if err := Init(); err != nil {
|
||||
t.Fatal(t)
|
||||
|
Loading…
x
Reference in New Issue
Block a user