Closed colemickens closed 8 years ago
@colemickens just confirming are you using the latest bits, there was bug in locating template path which i fixed. I just pulled the latest code and tried. It worked
If you have an older version then you might want to remove 'azure-vhd-utils-for-go' from GOPATH/src/Microsoft before "go getting" the latest.
I just destroyed my entire GOPATH and reran it. Still repros.
$ cd $GOPATH/src/github.com/Mirosoft/azure-vhd-utils-for-go
$ git log
[...]
commit f291a0767221c47a9413038b58a4bbfb3b62ab95
[...]
Date: Sun Mar 6 21:22:04 2016 -0800
[...]
@colemickens could you try this:
1] cd $GOPATH/src/github.com/Mirosoft/azure-vhd-utils-for-go 2] go build 3] ./azure-vhd-utils-for-go inspect footer /nix/store/igjb0w7jpjk43sxwk53l21mz118ivghn-azure-image/disk.vhd
Yup, that works.
cool! The issue is, when we do "go get azure-vhd-utils-for-go", it build the binary "azure-vhd-utils-for-go" and put it in "$GOPATH/bin". This binary is unable to locate the template path because it's relative in the source code.
Yup, I have a similar problem with one of my projects. I'm currently solving it by distributing the binary + template folder in a docker container and encouraging people to run it that way, but that feels heavy for a tool like this. The other thing I'd considered was just embedding the template files as string constants in my Go source code, but I'm not crazy about that idea either.
Thanks for the fast support!
Thanks for sharing your experience, I guess in case of this tool - reasonable solution is to include template file content as string constants, I will do that.
Let me know if you come across better way of handling this.
closing, this issue is addressed by moving the templates to source file.