donglin1692 2014-09-09 13:35
浏览 5
已采纳

如何在Go中声明时间? [关闭]

I have been walking through the tutorials and know how to declare variables but can not find how to declare of variable as type Time.

How Time is declared in Go?

  • 写回答

1条回答 默认 最新

  • dongling5411 2014-09-09 13:45
    关注

    You will find plenty of example of Time variable declaration in the package time itself, as in the Duration example

     t0 := time.Now()
    

    This is using the "short variable declaration", which is a shorthand for a regular variable declaration with initializer expressions but no types.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?