Hi,

I have read golang documents and FAQ but didn't find an answer to this.

The question is that when I run "go build ./<a_package>" to build a binary, 
it is sometimes different from the result generated by "go build main.go", 
at least for the package below.

For example, this can be easily reproduced:

$ cd test5
$ ls
$ pwd
/Users/xxx/test5
$ export GOPATH=/Users/xxx/test5
$ go get -d github.com/golang/protobuf/protoc-gen-go
$ ls
src
$ cd src
$ ls
github.com
$ cd github.com/golang/protobuf/
$ ls
AUTHORS       LICENSE       Makefile      jsonpb        protoc-gen-go
CONTRIBUTORS  Make.protobuf README.md     proto         ptypes
$ go build -o correct_binary ./protoc-gen-go
$ cd protoc-gen-go/
$ go build -o wrong_binary main.go

-rwxr-xr-x   1 xxx  staff  5551904 Jul 22 23:48 wrong_binary

-rwxr-xr-x   1 xxx  staff  5664432 Jul 22 23:48 correct_binary

It seems that the "correct_binary" will generate go codes for gRPC proto 
correctly as protoc plugin but the "wrong_binary" will not.

What's the reason behind this?

Thanks.

Yan


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to