osx - 6g: No such file or directory - Building Go packages with `gomake` on Snow Leopard -
osx - 6g: No such file or directory - Building Go packages with `gomake` on Snow Leopard -
i have 2 .go files, numbers.go , numbers_test.go , want build , execute tests per creating new bundle tutorial (scroll downwards details on files.) files in same directory.
when navigate directory in terminal , type gomake this:
6g -o _go_.6 numbers.go make: 6g: no such file or directory make: *** [_go_.6] error 1 this error saying cannot find numbers.go. if manually execute line (without moving directory):
6g -o _go_.6 numbers.go it creates _go_.6 file. why can't gomake find file?
here files using:
numbers.go looks this:
package numbers func double(i int) int { homecoming * 2 } numbers_test.go looks this:
package numbers import ( "testing" ) type doubletest struct { in, out int } var doubletests = []doubletest{ doubletest{1, 2}, doubletest{2, 4}, doubletest{-5, -10}, } func testdouble(t *testing.t) { _, dt := range doubletests { v := double(dt.in) if v != dt.out { t.errorf("double(%d) = %d, want %d.", dt.in, v, dt.out) } } } and finally, makefile looks this:
include $(goroot)/src/make.inc targ=numbers gofiles=\ numbers.go include $(goroot)/src/make.pkg
the error doesn't can't find numbers.go - it's saying can't find 6g. in makefile, seek putting path 6g in path, other go-specific environment variables.
osx go
Comments
Post a Comment