Skip to content

Commit

Permalink
chore: remove files for old Go versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jszwec committed Feb 14, 2023
1 parent 63db5fb commit ddb9b0b
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 180 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
strategy:
matrix:
go-version: [1.17, 1.18]
go-version: ["1.20"]
os: [ubuntu-latest, macos-latest, windows-latest]

runs-on: ${{ matrix.os }}
Expand All @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.8, 1.9, "1.10"]
go-version: [1.18, 1.19]
steps:
- uses: actions/checkout@v2
with:
Expand Down
12 changes: 12 additions & 0 deletions cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,20 @@ package csvutil
import (
"reflect"
"sort"
"sync"
)

var fieldCache sync.Map // map[typeKey][]field

func cachedFields(k typeKey) fields {
if v, ok := fieldCache.Load(k); ok {
return v.(fields)
}

v, _ := fieldCache.LoadOrStore(k, buildFields(k))
return v.(fields)
}

type field struct {
name string
baseType reflect.Type
Expand Down
31 changes: 0 additions & 31 deletions cache_go17.go

This file was deleted.

19 changes: 0 additions & 19 deletions cache_go19.go

This file was deleted.

6 changes: 6 additions & 0 deletions csvutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,9 @@ loop:
}
return typ, nil
}

func newCSVReader(r io.Reader) *csv.Reader {
rr := csv.NewReader(r)
rr.ReuseRecord = true
return rr
}
39 changes: 0 additions & 39 deletions csvutil_go110_test.go

This file was deleted.

25 changes: 0 additions & 25 deletions csvutil_go113_test.go

This file was deleted.

13 changes: 0 additions & 13 deletions csvutil_go17.go

This file was deleted.

36 changes: 0 additions & 36 deletions csvutil_go17_test.go

This file was deleted.

15 changes: 0 additions & 15 deletions csvutil_go19.go

This file was deleted.

0 comments on commit ddb9b0b

Please sign in to comment.