Skip to content

Commit

Permalink
Upgrade go and golangci-lint version
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-rai committed Jan 30, 2025
1 parent af781c8 commit 526ead5
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
with:
fetch-depth: 2

- uses: actions/setup-go@v4
- uses: actions/setup-go@v5
with:
go-version: '^1.21.3'
go-version: '^1.23.5'
- run: go version

- name: Install gofumpt
Expand All @@ -38,7 +38,7 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
version: v1.63
args: --verbose --timeout=3m

- name: Test
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
run:
skip-files:
issues:
exclude-files:
- regexes.go
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ GOCMD=GO111MODULE=on go
linters-install:
@golangci-lint --version >/dev/null 2>&1 || { \
echo "installing linting tools..."; \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.52.2; \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.63.4; \
}

lint: linters-install
Expand Down
2 changes: 1 addition & 1 deletion custom/decimal/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hypersequent/zen/custom/decimal

go 1.21
go 1.23

replace github.com/hypersequent/zen => ../..

Expand Down
2 changes: 1 addition & 1 deletion custom/optional/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hypersequent/zen/custom/optional

go 1.21
go 1.23

replace github.com/hypersequent/zen => ../..

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/hypersequent/zen

go 1.21
go 1.23

require github.com/stretchr/testify v1.8.3

Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.21
go 1.23

use (
.
Expand Down
50 changes: 50 additions & 0 deletions notes
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
func (c *Converter) convertStructTopLevel(t reflect.Type) string
func (c *Converter) getType(t reflect.Type, name string, indent int) string

func (c *Converter) convertStruct(input reflect.Type, indent int) string
func (c *Converter) getTypeStruct(input reflect.Type, indent int) string

func (c *Converter) convertField(f reflect.StructField, indent int, optional, nullable, anonymous bool) (string, bool)
func (c *Converter) getTypeField(f reflect.StructField, indent int, optional, nullable bool) string

func (c *Converter) convertSliceAndArray(t reflect.Type, name, validate string, indent int) string
func (c *Converter) getTypeSliceAndArray(t reflect.Type, name string, indent int) string

func (c *Converter) convertMap(t reflect.Type, name, validate string, indent int) string
func (c *Converter) getTypeMap(t reflect.Type, name string, indent int) string

func (c *Converter) validateString(validate string) string
func (c *Converter) validateNumber(validate string) string

type Converter struct {
prefix string
structs int
outputs map[string]entry
custom map[string]CustomFn
stack []meta
}

type entry struct {
order int
data string
}

type meta struct {
Name string
SelfRef bool
}

// name, generic, validate, indent
type CustomFn func(*Converter, reflect.Type, string, string, string, int) string

type byOrder []entry

func (a byOrder) Len() int { return len(a) }
func (a byOrder) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (a byOrder) Less(i, j int) bool { return a[i].order < a[j].order }

func (c *Converter) AddType(input interface{})
func (c *Converter) Convert(input interface{}) string
func (c *Converter) ConvertSlice(inputs []interface{}) string
func (c *Converter) ConvertType(t reflect.Type, name string, validate string, indent int) string
func (c *Converter) Export() string

0 comments on commit 526ead5

Please sign in to comment.