Skip to content

Conversation

@diamondburned
Copy link
Contributor

This first executes go version then parses it. If it fails, it reads zversion.go. If all else fails, it dies like usual.

@diamondburned diamondburned changed the base branch from master to dev July 4, 2019 03:06
Removed redundant error

Uses `go version' and zversion.go to detect version, fixes tinygo-org#433
@aykevl
Copy link
Member

aykevl commented Jul 6, 2019

Merged in aabb6ba. Thank you for your contribution!

@gertcuykens
Copy link

Fails for me when go version is build from the go master branch

% go version           
go version devel +c170b14c2c Tue Dec 24 16:13:37 2019 +0000 darwin/amd64 

@aykevl
Copy link
Member

aykevl commented Jan 30, 2020

Hmm, I'm not sure what to do in that case. It looks like Go won't print any version at all. Maybe falling back to the Go version TinyGo was built with would be the best in that case? That's usually the latest version or close to it.

@gertcuykens
Copy link

gertcuykens commented Jan 30, 2020

When you use the master branch and generate a go.mod file (go mod init) it generates the correct version in it. Maybe take a look how go mod init does it?

$ cat go.mod
module example.com/hello
go 1.14
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants