Files
zeekay 22b3f5ce2b hanzo-ds/go: branded datastore client, rebased on clickhouse-go v2.44.0
Feature-complete v2.44.0 (lib/churl, lib/col, BFloat16, QBit, scanTypeDuration,
Options.Logger *slog.Logger) — fixes the [email protected].0 downgrade RED caught.
Package datastore, module github.com/hanzo-ds/go, depends only on hanzo-ds/native.
Wire strings preserved VERBATIM (X-ClickHouse-* headers, sql.Register("clickhouse"),
clickhouse:// DSN, ClientName="clickhouse-go") — consistent with native.
2026-07-10 13:11:20 -07:00

28 lines
442 B
Go

package timezone
import (
"sync"
"time"
)
var cache = struct {
mutex sync.Mutex
items map[string]*time.Location
}{
items: make(map[string]*time.Location),
}
func Load(name string) (*time.Location, error) {
cache.mutex.Lock()
defer cache.mutex.Unlock()
if tz, found := cache.items[name]; found {
return tz, nil
}
tz, err := time.LoadLocation(name)
if err != nil {
return nil, err
}
cache.items[name] = tz
return tz, nil
}