Skip to content

Commit

Permalink
updated ext lib
Browse files Browse the repository at this point in the history
  • Loading branch information
wakeful committed Apr 27, 2024
1 parent ace19ee commit 50b9d71
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
- run: git fetch --force --tags
- uses: actions/setup-go@v3
with:
go-version: '>=1.19.2'
go-version: '>=1.22.2'
cache: true
- uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27 changes: 23 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,30 @@
linters:
enable-all: true
disable:
- forbidigo
- funlen
- deadcode
- exhaustivestruct
- exhaustruct
- golint
- ifshort
- interfacer
- lll
- gochecknoglobals
- maligned
- nosnakecase
- paralleltest
- scopelint
- structcheck
- testpackage
- varnamelen
- varcheck
issues:
exclude-rules:
- path: _test.go
linters:
- funlen
- varnamelen
linters-settings:
depguard:
rules:
main:
allow:
- $gostd
- github.com/wakeful/yaml2json/pkg/parse
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# todo add to CI
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.6.0
hooks:
- id: check-case-conflict
- id: trailing-whitespace
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module github.com/wakeful/yaml2json

go 1.19
go 1.22

require gopkg.in/yaml.v2 v2.4.0
require gopkg.in/yaml.v3 v3.0.1
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion pkg/parse/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"fmt"

"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func decode(input interface{}) interface{} {
Expand Down
1 change: 1 addition & 0 deletions pkg/parse/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ bar:

return
}

if got != tt.want {
t.Errorf("ByteSliceToJSON() got = %v, want %v", got, tt.want)
}
Expand Down
6 changes: 2 additions & 4 deletions yaml2json.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import (
"github.com/wakeful/yaml2json/pkg/parse"
)

var (
showVersion = flag.Bool("version", false, "show version and exit")
version = "dev"
)
var version = "dev"

func main() {
showVersion := flag.Bool("version", false, "show version and exit")
flag.Parse()

const url = "https://github.com/wakeful/yaml2json"
Expand Down

0 comments on commit 50b9d71

Please sign in to comment.