berend

berend

loving to code, full of ideas and projects, but low on time :-(

Member Since 10 years ago

esome, Hamburg

Experience Points
17
follower
Lessons Completed
24
follow
Lessons Completed
100
stars
Best Reply Awards
22
repos

11 contributions in the last year

Pinned
⚡ API Wrapper for haveibeenpwnd
⚡ validate and generate IBANs
⚡ A python library for accessing and searching dictionaries via /slashed/paths ala xpath
⚡ Numpy main repository
Activity
Jan
17
2 days ago
Jan
5
2 weeks ago
Activity icon
issue

berend issue golang/go

berend
berend

time.Date.AddDate(0,0,0) creates a difference when performed on DST change

What version of Go are you using (go version)?

$ go version
go version go1.17.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes, this is happening in the playground versions "release" and "go dev branch"

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/berend.kapelle/Library/Caches/go-build"
GOENV="/Users/berend.kapelle/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/berend.kapelle/.go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/berend.kapelle/.go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/opt/go/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64"
GOVCS=""
GOVERSION="go1.17.2"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/cm/0bvssb694y1812pzbb3xb7gh0000gn/T/go-build4066904548=/tmp/go-build -gno-record-gcc-switches -fno-common"

(I emptied GONOPROXY, GONOSUMDB and GOPRIVATE, because they are pointing to a private gitlab instance)

What did you do?

  • create time.Date via time.Add() that points to exact DST change
  • .AddDate(0,0,0)

Playground: https://go.dev/play/p/pC1w7JVWqUX

What did you expect to see?

That .AddDate(0,0,0) does not create a different time.Date

What did you see instead?

the time.Date, that .AddDate(0,0,0) created has a difference of one hour

I know, that AddDate does Normalization:

// AddDate normalizes its result in the same way that Date does,
// so, for example, adding one month to October 31 yields
// December 1, the normalized form for November 31.

but I still think, that .AddDate(0,0,0) should create the same time.Date

This behaviour does not appear with .Add(0)

Dec
20
4 weeks ago
Dec
13
1 month ago
Nov
17
2 months ago
push

berend push esome/gateway

berend
berend

avoid race condition described in #141 (#142)

berend
berend

Remove the internal schema as a package level var to fix race issues (#148)

This triggers the Go race detector when using the gateway in tests.

There is very little advantage to having the package level var.

berend
berend

Separate CLI and example dependencies, support 'go install' (#151)

  • Use multi-module setup to reduce dependency footprint

  • Remove execute permission from go.mod, go.sum

  • Move command to cmd/nautilus to fix installed binary name

  • Add install instructions using the Go CLI

commit sha: 5d984b36965ab4c5a1903388ffcb1d58277f56cf

push time in 2 months ago
Nov
4
2 months ago
started
started time in 2 months ago
Nov
1
2 months ago
started
started time in 2 months ago