FAQ
I'm trying to calculate the difference between two dates in terms of days,
but I'm seeing the error:
(mismatched types func() float64 and float64)
Can someone please tell me where I'm going wrong? Here is an example of my
code:

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

Thanks,
Matt

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Martin Schnabel at Nov 30, 2014 at 1:22 pm

    On 11/30/2014 02:19 PM, Matt Bostock wrote:
    I'm trying to calculate the difference between two dates in terms of
    days, but I'm seeing the error:
    (mismatched types func() float64 and float64)
    Can someone please tell me where I'm going wrong? Here is an example of
    my code:

    http://play.golang.org/p/mxaVhmJjz6
    http://play.golang.org/p/OZRkzrvvT3

    Hours is a method on time.Duration not a field.

    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Matt Bostock at Nov 30, 2014 at 1:25 pm
    Thanks Martin :-)
    On 30 November 2014 at 13:22, Martin Schnabel wrote:
    On 11/30/2014 02:19 PM, Matt Bostock wrote:

    I'm trying to calculate the difference between two dates in terms of
    days, but I'm seeing the error:
    (mismatched types func() float64 and float64)
    Can someone please tell me where I'm going wrong? Here is an example of
    my code:

    http://play.golang.org/p/mxaVhmJjz6
    http://play.golang.org/p/OZRkzrvvT3

    Hours is a method on time.Duration not a field.

    --
    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+unsubscribe@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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Matt Bostock at Nov 30, 2014 at 1:23 pm
    I found my error; I was missing parentheses on the Hour() function.

    Here is the working code:
    http://play.golang.org/p/OZRkzrvvT3
    On 30 November 2014 at 13:19, Matt Bostock wrote:

    I'm trying to calculate the difference between two dates in terms of days,
    but I'm seeing the error:
    (mismatched types func() float64 and float64)
    Can someone please tell me where I'm going wrong? Here is an example of my
    code:

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

    Thanks,
    Matt
    --
    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+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 30, '14 at 1:20p
activeNov 30, '14 at 1:25p
posts4
users2
websitegolang.org

2 users in discussion

Matt Bostock: 3 posts Martin Schnabel: 1 post

People

Translate

site design / logo © 2022 Grokbase