FAQ
I am trying to compute a minimum value, given a slice containing values of
the type "time.Time" but running into error :

cannot use t[:1] (type []time.Time) as type time.Time in function argument


I have posted the code at http://play.golang.org/p/pGCG9HYSTS and help is much appreciated.

--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Ian Lance Taylor at Nov 27, 2013 at 10:48 pm

    On Wed, Nov 27, 2013 at 2:35 PM, Satish Puranam wrote:
    I am trying to compute a minimum value, given a slice containing values of
    the type "time.Time" but running into error :

    cannot use t[:1] (type []time.Time) as type time.Time in function argument


    I have posted the code at http://play.golang.org/p/pGCG9HYSTS and help is
    much appreciated.
    You wrote t[:1] where (I assume) you meant to write t[1].

    http://play.golang.org/p/sf1uqvYq6B

    Ian

    --
    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 [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.
  • Nigel Tao at Nov 28, 2013 at 2:42 am

    On Thu, Nov 28, 2013 at 9:48 AM, Ian Lance Taylor wrote:
    You wrote t[:1] where (I assume) you meant to write t[1].
    A slight typo: t[1] should be t[0], so the line is:
    m := minimum(t[0], t[1:]...)

    --
    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 [email protected].
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 27, '13 at 10:35p
activeNov 28, '13 at 2:42a
posts3
users3
websitegolang.org

People

Translate

site design / logo © 2023 Grokbase