Skip to content

Commit

Permalink
Make LoadGeoJSON be private
Browse files Browse the repository at this point in the history
  • Loading branch information
albertyw committed Mar 19, 2023
1 parent a730004 commit a4c1191
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions localtimezone.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ func init() {
type LocalTimeZone interface {
GetZone(p Point) (tzids []string, err error)
GetOneZone(p Point) (tzid string, err error)
LoadGeoJSON(io.Reader) error
}

type tzData struct {
Expand Down Expand Up @@ -125,7 +124,7 @@ func NewMockLocalTimeZone() LocalTimeZone {
// The client is threadsafe
func NewCustomLocalTimeZone(data io.Reader) (LocalTimeZone, error) {
z := localTimeZone{}
err := z.LoadGeoJSON(data)
err := z.loadGeoJSON(data)
return &z, err
}

Expand All @@ -135,7 +134,7 @@ func (z *localTimeZone) load(shapeFile []byte) error {
return err
}

err = z.LoadGeoJSON(g)
err = z.loadGeoJSON(g)
_ = g.Close()
if err != nil {
return err
Expand Down Expand Up @@ -275,8 +274,8 @@ func (z *localTimeZone) buildCache(features []*geojson.Feature) {
sort.Strings(z.tzids)
}

// LoadGeoJSON loads a custom GeoJSON shapefile from a Reader
func (z *localTimeZone) LoadGeoJSON(r io.Reader) error {
// loadGeoJSON loads a custom GeoJSON shapefile from a Reader
func (z *localTimeZone) loadGeoJSON(r io.Reader) error {
z.mu.Lock()

var buf bytes.Buffer
Expand Down
2 changes: 1 addition & 1 deletion localtimezone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ func TestLoadGeoJSONMalformed(t *testing.T) {
if !ok {
t.Errorf("cannot initialize client")
}
err = c.LoadGeoJSON(reader)
err = c.loadGeoJSON(reader)
if err == nil {
t.Errorf("expected error, got %v", err)
}
Expand Down

0 comments on commit a4c1191

Please sign in to comment.