On Thu, Jul 20, 2017 at 2:50 PM, Helton Marques wrote:
>
> Yeah, I now, but considering these proposal:
> https://github.com/golang/go/issues/20757
> This function (IsZero) would not bring even more reliable use ?
Sure, if we adopt proposal #20757 we may well need or at least want an
IsZero metho
Yeah, I now, but considering these proposal:
https://github.com/golang/go/issues/20757
This function (IsZero) would not bring even more reliable use ?
Em quinta-feira, 20 de julho de 2017 22:12:04 UTC+2, Ian Lance Taylor
escreveu:
>
> On Thu, Jul 20, 2017 at 1:02 PM, Helton Marques > wrote:
>
On Thu, Jul 20, 2017 at 1:02 PM, Helton Marques wrote:
>
> There's some reason to not have the function `IsZero` to time.Duration ?
>
> IMO, I think this can be useful:
>
>
> ```
> type Server struct { timeout time.Duration `yaml:"timeout:"` }
> ...
> if srv.timeout.IsZero() { srv.timeout = defaul
There's some reason to not have the function `IsZero` to time.Duration ?
IMO, I think this can be useful:
```
type Server struct { timeout time.Duration `yaml:"timeout:"` }
...
if srv.timeout.IsZero() { srv.timeout = defaultServerTimeout }
```
Anyone knows if there's some restriction to not h