Skip to content

Instantly share code, notes, and snippets.

@andydude
Created April 5, 2012 16:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andydude/2312513 to your computer and use it in GitHub Desktop.
Save andydude/2312513 to your computer and use it in GitHub Desktop.
Smallest example of a weird build error "nested/sub.Foo: undefined: nested/sub.bar"
// file: nested/foo/foo.go
package main
import "nested/sub"
func main() {
nestedsub.Foo()
}
// file: nested/nested.go
package nested
// theoretical stuff
// file: nested/sub/nested.c
#include <runtime.h>
void
nestedsub·bar() {
runtime·prints("hello");
}
// file: nested/sub/nested.go
package nestedsub
func bar()
func Foo() {
bar()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment