You might want to follow the discussion in golang.org/issue/21207 which
might be related to this, depending on the reason you need to know the
minimum Go version. `go version` doesn't return the version number on
non-tagged releases so if you're building off of tip, for example, the
output is a bit harder to parse in terms "what's the minimum tagged
version?"

Hopefully that's helpful,
Chris

On Wed, Aug 9, 2017 at 7:05 AM, Noilson Caio <caiog...@gmail.com> wrote:

> Maybe something like this may help you
>
> #!/bin/bash## requirements: bc, awk, tr, cut##_gocurrel="$(go version|awk 
> '{print $3}'|tr -d "go"|cut -d"." -f1-2)"_gominrel="1.5"###_key=$(echo 
> "$_gominrel > $_gocurrel" | bc -l)###if [ "$_key" != "0" ]then
>       echo "Ops! Current go release is $_gocurrel and you need $_gominrel"
>       exit 1fi###
>
>
>
> On Wed, Aug 9, 2017 at 10:15 AM, Shawn Milochik <shawn.m...@gmail.com>
> wrote:
>
>> Running "go version" at the command line returns a version number. You
>> can parse that.
>>
>> --
>> 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.
>>
>
>
>
> --
> Noilson Caio Teixeira de Ara├║jo
> https://ncaio.wordpress.com
> https://br.linkedin.com/in/ncaio
> https://twitter.com/noilsoncaio
> https://jammer4.wordpress.com/
> http://8bit.academy
>
>
> --
> 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.
>

-- 
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