可以使用特定Go版本的Golang构建标签吗? [重复]

This question already has an answer here:

Using build tags alone is it possible to target a particular Go version in a file?

// +build go1.7

eg. with the adding of golang.org/x/net/context to the standard lib, I have some code that I want to update to use the std lib context ( when it's released ) but be able to maintain backward compatibility for those that have not yet updated.

I know there are many ways to control this including the branch name and go get, just wondering if there's a way using build tags.

Thanks in Advance.

</div>

Put the code that depends on contexts in a file with the following build tag. This code is compiled for Go 1.7 and onward.

// +build go1.7

Put the backwards compatibility code in a file with the following build tag. This code is used for all versions of Go before 1.7.

// +build !go1.7