go-leapsecond is the tool of leap seconds.
go get -u github.com/DestinyLab/go-leapsecond
package main
import (
"fmt"
"time"
"github.com/DestinyLab/go-leapsecond"
)
func main() {
t1 := time.Date(2017, 10, 1, 0, 0, 0, 0, time.UTC)
fmt.Printf("%v", leapsecond.Have(t1))
// Output: 27s
t2 := time.Date(2010, 12, 1, 0, 0, 0, 0, time.UTC)
fmt.Printf("%v", leapsecond.Diff(t1, t2))
// Output: 3s
}