From dc37e86421d669c301e62fbc47f5e74aa02fafce Mon Sep 17 00:00:00 2001 From: Achilleas Anagnostopoulos Date: Sat, 1 Jul 2017 18:27:31 +0100 Subject: [PATCH] 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. --- src/gopheros/kernel/goruntime/bootstrap_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gopheros/kernel/goruntime/bootstrap_test.go b/src/gopheros/kernel/goruntime/bootstrap_test.go index cec83a7..37d1287 100644 --- a/src/gopheros/kernel/goruntime/bootstrap_test.go +++ b/src/gopheros/kernel/goruntime/bootstrap_test.go @@ -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)