Skip to content

Commit 4d32189

Browse files
authored
bump core to 2.3.2 (#104)
* bump core to 2.3.2 * remove unsupported linter
1 parent 1640119 commit 4d32189

File tree

8 files changed

+44
-25
lines changed

8 files changed

+44
-25
lines changed

.github/workflows/ci-lint.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ jobs:
1313
- uses: actions/setup-go@v5
1414
with:
1515
go-version: 1.23.4
16-
- uses: golangci/golangci-lint-action@v6
17-
with:
18-
version: v1.62.2
16+
- name: install golangci-lint
17+
run:
18+
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $GITHUB_WORKSPACE v1.60.3
19+
- name: lint
20+
run: |
21+
go version
22+
$GITHUB_WORKSPACE/golangci-lint version
23+
$GITHUB_WORKSPACE/golangci-lint --config .golangci.yml run

.golangci.yml

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
service:
2-
golangci-lint-version: 1.51.x
2+
golangci-lint-version: 1.60.3
33

44
run:
55
timeout: 2m
6-
exclude-dirs:
7-
- vendor
86

97
linters-settings:
108
govet:
119
shadow: true
12-
revive:
13-
min-confidence: 0.1
14-
rules:
15-
# Add more comments for exported functions and remove this rule
16-
- name: package-comments
17-
disabled: true
1810
maligned:
1911
suggest-new: true
2012
goconst:
@@ -24,46 +16,55 @@ linters-settings:
2416
locale: US
2517
lll:
2618
line-length: 140
19+
revive:
20+
min-confidence: 0.1
21+
rules:
22+
# Add more comments for exported functions and remove this rule
23+
- name: package-comments
24+
disabled: true
2725

2826
linters:
2927
enable:
3028
- bodyclose
3129
- revive
3230
- govet
3331
- unconvert
34-
- gosec
3532
- gocyclo
36-
- dupl
3733
- misspell
3834
- unparam
3935
- typecheck
4036
- ineffassign
4137
- stylecheck
4238
- gochecknoinits
43-
- gocritic
39+
- copyloopvar
4440
- nakedret
4541
- gosimple
4642
- prealloc
47-
- unused
4843
- goimports
4944
- gofmt
5045
- errcheck
5146
- staticcheck
52-
- exportloopref
5347

48+
## format - fill free to fix
49+
# - errcheck
50+
# - gofmt
5451
fast: false
55-
disable-all: true
52+
disable:
53+
- dupl
5654

5755
issues:
5856
exclude-rules:
59-
# - Fix and remove
57+
# - Fix and remove
6058
- text: "at least one file in a package should have a package comment"
6159
linters:
6260
- stylecheck
63-
# - Fix and remove
64-
- text: "should have a package comment, unless it's in another file for this package"
61+
# - Fix and remove
62+
- text: "package-comments: should have a package comment"
6563
linters:
6664
- revive
65+
- text: "shadow: declaration of \"err\" shadows declaration"
66+
linters:
67+
- govet
6768
- path: _test\.go
6869
linters:
6970
- gosec

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/iden3/go-schema-processor/v2
33
go 1.18
44

55
require (
6-
github.com/iden3/go-iden3-core/v2 v2.3.1
6+
github.com/iden3/go-iden3-core/v2 v2.3.2
77
github.com/iden3/go-iden3-crypto v0.0.17
88
github.com/iden3/go-merkletree-sql/v2 v2.0.4
99
// We require the `json-gold` bugfix which has not yet been included in the

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
22
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
33
github.com/dchest/blake512 v1.0.0 h1:oDFEQFIqFSeuA34xLtXZ/rWxCXdSjirjzPhey5EUvmA=
44
github.com/dchest/blake512 v1.0.0/go.mod h1:FV1x7xPPLWukZlpDpWQ88rF/SFwZ5qbskrzhLMB92JI=
5-
github.com/iden3/go-iden3-core/v2 v2.3.1 h1:ytQqiclnVAIWyRKR2LF31hfz4DGRBD6nMjiPILXGSKk=
6-
github.com/iden3/go-iden3-core/v2 v2.3.1/go.mod h1:8vmG6y8k9VS7iNoxuiKukKbRQFsMyabCc+i8er07zOs=
5+
github.com/iden3/go-iden3-core/v2 v2.3.2 h1:kZq/TiSUmBKO/mvPUucfFE45ugTW+hXXlGT+Jf6CQTg=
6+
github.com/iden3/go-iden3-core/v2 v2.3.2/go.mod h1:8vmG6y8k9VS7iNoxuiKukKbRQFsMyabCc+i8er07zOs=
77
github.com/iden3/go-iden3-crypto v0.0.17 h1:NdkceRLJo/pI4UpcjVah4lN/a3yzxRUGXqxbWcYh9mY=
88
github.com/iden3/go-iden3-crypto v0.0.17/go.mod h1:dLpM4vEPJ3nDHzhWFXDjzkn1qHoBeOT/3UEhXsEsP3E=
99
github.com/iden3/go-merkletree-sql/v2 v2.0.4 h1:Dp089P3YNX1BE8+T1tKQHWTtnk84Y/Kr7ZAGTqwscoY=

loaders/document_loader.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,16 @@ const (
2323

2424
var rApplicationJSON = regexp.MustCompile(`^application/(\w*\+)?json$`)
2525

26+
// ErrCacheMiss is an error when there is no info in cache
2627
var ErrCacheMiss = errors.New("cache miss")
2728

29+
// CacheEngine is engine interface for cache storages
2830
type CacheEngine interface {
2931
Get(key string) (doc *ld.RemoteDocument, expireTime time.Time, err error)
3032
Set(key string, doc *ld.RemoteDocument, expireTime time.Time) error
3133
}
3234

35+
// IPFSClient interface
3336
type IPFSClient interface {
3437
Cat(url string) (io.ReadCloser, error)
3538
}
@@ -42,8 +45,10 @@ type documentLoader struct {
4245
httpClient *http.Client
4346
}
4447

48+
// DocumentLoaderOption is an option for document loader
4549
type DocumentLoaderOption func(*documentLoader)
4650

51+
// WithCacheEngine is an option for setting cache
4752
func WithCacheEngine(cacheEngine CacheEngine) DocumentLoaderOption {
4853
return func(loader *documentLoader) {
4954
if cacheEngine == nil {
@@ -55,6 +60,7 @@ func WithCacheEngine(cacheEngine CacheEngine) DocumentLoaderOption {
5560
}
5661
}
5762

63+
// WithHTTPClient is an option for setting http client
5864
func WithHTTPClient(httpClient *http.Client) DocumentLoaderOption {
5965
return func(loader *documentLoader) {
6066
loader.httpClient = httpClient
@@ -82,6 +88,7 @@ func NewDocumentLoader(ipfsCli IPFSClient, ipfsGW string,
8288
return loader
8389
}
8490

91+
// LoadDocument loads document from ipfs or http / https source
8592
func (d *documentLoader) LoadDocument(
8693
u string) (doc *ld.RemoteDocument, err error) {
8794

loaders/memory_cache.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@ func (m *memoryCacheEngine) Set(key string, doc *ld.RemoteDocument,
6262
return nil
6363
}
6464

65+
// MemoryCacheEngineOption is an option to set cache engine
6566
type MemoryCacheEngineOption func(*memoryCacheEngine) error
6667

68+
// WithEmbeddedDocumentBytes sets bytes for given url
6769
func WithEmbeddedDocumentBytes(u string, doc []byte) MemoryCacheEngineOption {
6870
return func(engine *memoryCacheEngine) error {
6971
if engine.embedDocs == nil {
@@ -81,6 +83,7 @@ func WithEmbeddedDocumentBytes(u string, doc []byte) MemoryCacheEngineOption {
8183
}
8284
}
8385

86+
// NewMemoryCacheEngine creates new memory cache engine
8487
func NewMemoryCacheEngine(
8588
opts ...MemoryCacheEngineOption) (CacheEngine, error) {
8689

testing/http.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,17 @@ type mockHTTPClientOptions struct {
7373
ignoreUntouchedURLs bool
7474
}
7575

76+
// MockHTTPClientOption is mock for http client for tests
7677
type MockHTTPClientOption func(*mockHTTPClientOptions)
7778

79+
// IgnoreUntouchedURLs is option to ignore unused urls
7880
func IgnoreUntouchedURLs() MockHTTPClientOption {
7981
return func(opts *mockHTTPClientOptions) {
8082
opts.ignoreUntouchedURLs = true
8183
}
8284
}
8385

86+
// MockHTTPClient is mocked http client
8487
func MockHTTPClient(t testing.TB, routes map[string]string,
8588
opts ...MockHTTPClientOption) func() {
8689

verifiable/did_doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func (a *Authentication) UnmarshalJSON(b []byte) error {
9595
if err != nil {
9696
return errors.Errorf("invalid json payload for authentication: %v", err)
9797
}
98-
*a = (Authentication)(tmp)
98+
*a = Authentication(tmp)
9999
case '"':
100100
err := json.Unmarshal(b, &a.did)
101101
if err != nil {

0 commit comments

Comments
 (0)