diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e1d8d4f..04cb915 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,41 +6,12 @@ name: Lint jobs: golangci: runs-on: ubuntu-latest - strategy: - matrix: - go: [ '1.16' ] steps: - name: Checkout code - uses: actions/checkout@v2 - - - name: Setup go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go }} - - - uses: actions/cache@v2 - with: - path: ~/.cache/golangci-lint - key: ${{ runner.os }}-golangcilint-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-golangci-lint- - - - uses: actions/cache@v2 - with: - path: ~/.cache/go-build - key: ${{ runner.os }}-gobuild-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-gobuild- - - - uses: actions/cache@v2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + uses: actions/checkout@v3 - name: golangci-lint - uses: reviewdog/action-golangci-lint@v1 + uses: reviewdog/action-golangci-lint@v2 with: reporter: github-pr-review filter_mode: diff_context diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d156248..229a70a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go: [ '1.16' ] + go: [ '1.18' ] steps: - name: Checkout code uses: actions/checkout@v2 diff --git a/go.mod b/go.mod index b7dd104..d45da91 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/tier4/x-go -go 1.17 +go 1.18 require ( github.com/aws/aws-sdk-go v1.43.8 diff --git a/ref/ref.go b/ref/ref.go new file mode 100644 index 0000000..fdad14b --- /dev/null +++ b/ref/ref.go @@ -0,0 +1,13 @@ +package ref + +func Ref[T any](s T) *T { + return &s +} + +func Deref[T any](p *T) T { + if p == nil { + var ret T + return ret + } + return *p +}