Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6aa1be0

Browse files
authoredSep 27, 2023
[skip-changelog] Use golangci-lint (#2338)
1 parent c004b42 commit 6aa1be0

File tree

34 files changed

+297
-304
lines changed

34 files changed

+297
-304
lines changed
 

‎.github/workflows/check-go-task.yml

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -49,39 +49,6 @@ jobs:
4949
5050
echo "result=$RESULT" >> $GITHUB_OUTPUT
5151
52-
check-errors:
53-
name: check-errors (${{ matrix.module.path }})
54-
needs: run-determination
55-
if: needs.run-determination.outputs.result == 'true'
56-
runs-on: ubuntu-latest
57-
58-
strategy:
59-
fail-fast: false
60-
61-
matrix:
62-
module:
63-
- path: ./
64-
65-
steps:
66-
- name: Checkout repository
67-
uses: actions/checkout@v4
68-
69-
- name: Install Go
70-
uses: actions/setup-go@v4
71-
with:
72-
go-version: ${{ env.GO_VERSION }}
73-
74-
- name: Install Task
75-
uses: arduino/setup-task@v1
76-
with:
77-
repo-token: ${{ secrets.GITHUB_TOKEN }}
78-
version: 3.x
79-
80-
- name: Check for errors
81-
env:
82-
GO_MODULE_PATH: ${{ matrix.module.path }}
83-
run: task go:vet
84-
8552
check-outdated:
8653
name: check-outdated (${{ matrix.module.path }})
8754
needs: run-determination
@@ -146,8 +113,10 @@ jobs:
146113
repo-token: ${{ secrets.GITHUB_TOKEN }}
147114
version: 3.x
148115

149-
- name: Install golint
150-
run: go install golang.org/x/lint/golint@latest
116+
- name: golangci-lint
117+
uses: golangci/golangci-lint-action@v3
118+
with:
119+
version: v1.54
151120

152121
- name: Check style
153122
env:

‎.golangci.yml

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
run:
2+
timeout: 10m
3+
go: "1.21"
4+
tests: true
5+
6+
linters:
7+
# Disable all linters.
8+
disable-all: true
9+
# Enable specific linter
10+
enable:
11+
# Nice to have
12+
#- depguard
13+
#- errcheck
14+
#- gocritic
15+
#- thelper
16+
- errorlint
17+
- dupword
18+
- exportloopref
19+
- forbidigo
20+
- gofmt
21+
- goimports
22+
- gosec
23+
- gosimple
24+
- govet
25+
- ineffassign
26+
- misspell
27+
- revive
28+
- staticcheck
29+
- tenv
30+
- typecheck
31+
- unconvert
32+
33+
linters-settings:
34+
forbidigo:
35+
forbid:
36+
- p: ^(fmt\.Print(|f|ln)|print|println)$
37+
msg: in cli package use `feedback.*` instead
38+
- p: (os\.(Stdout|Stderr|Stdin))(# )?
39+
msg: in cli package use `feedback.*` instead
40+
analyze-types: true
41+
42+
revive:
43+
confidence: 0.8
44+
rules:
45+
#- name: error-return
46+
#- name: unused-parameter
47+
#- name: var-naming
48+
- name: blank-imports
49+
- name: context-as-argument
50+
- name: context-keys-type
51+
- name: dot-imports
52+
- name: empty-block
53+
- name: error-naming
54+
- name: error-strings
55+
- name: errorf
56+
- name: exported
57+
- name: increment-decrement
58+
- name: indent-error-flow
59+
- name: package-comments
60+
- name: range
61+
- name: receiver-naming
62+
- name: redefines-builtin-id
63+
- name: superfluous-else
64+
- name: time-naming
65+
- name: unexported-return
66+
- name: unreachable-code
67+
- name: var-declaration
68+
- name: defer
69+
- name: atomic
70+
- name: waitgroup-by-value
71+
72+
errorlint:
73+
# Check for plain error comparisons.
74+
comparison: true
75+
76+
# We might evalute to allow the asserts and errofs in the future
77+
# Do not check for plain type assertions and type switches.
78+
asserts: false
79+
# Do not check whether fmt.Errorf uses the %w verb for formatting errors.
80+
errorf: false
81+
82+
issues:
83+
# Fix found issues (if it's supported by the linter).
84+
fix: true
85+
# List of regexps of issue texts to exclude.
86+
#
87+
# But independently of this option we use default exclude patterns,
88+
# it can be disabled by `exclude-use-default: false`.
89+
# To list all excluded by default patterns execute `golangci-lint run --help`
90+
#
91+
# Default: https://golangci-lint.run/usage/false-positives/#default-exclusions
92+
exclude-rules:
93+
# Exclude some linters from running on tests files.
94+
- path: _test\.go
95+
linters: [gosec, errcheck]
96+
# G401: Use of weak cryptographic primitive
97+
- linters: [gosec]
98+
text: "G401"
99+
# G501: Blocklisted import crypto/md5: weak cryptographic primitive
100+
- linters: [gosec]
101+
text: "G501"
102+
# G112: Potential Slowloris Attack because ReadHeaderTimeout is not configured in the http.Server
103+
- linters: [gosec]
104+
path: internal/integrationtest/
105+
text: "G112"
106+
# G204: Subprocess launched with a potential tainted input or cmd arguments
107+
- linters: [gosec]
108+
path: executils/process.go
109+
text: "G204"
110+
# SA1019: req.GetQuery is deprecated: Marked as deprecated in cc/arduino/cli/commands/v1/lib.proto.
111+
- linters: [staticcheck]
112+
path: commands/lib/search.go
113+
text: "SA1019"
114+
115+
# Ignore revive emptyblock
116+
- linters: [revive]
117+
path: arduino/libraries/loader.go
118+
text: "empty-block"
119+
- linters: [revive]
120+
path: arduino/serialutils/serialutils.go
121+
text: "empty-block"
122+
- linters: [revive]
123+
path: arduino/resources/download.go
124+
text: "empty-block"
125+
- linters: [revive]
126+
path: arduino/builder/internal/progress/progress_test.go
127+
text: "empty-block"
128+
- linters: [revive]
129+
path: internal/algorithms/channels.go
130+
text: "empty-block"
131+
132+
# Run linters only on specific path
133+
- path-except: internal/cli/
134+
linters:
135+
- forbidigo
136+
- path: internal/cli/feedback/
137+
linters: [forbidigo]

‎Taskfile.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,12 @@ tasks:
8080
dir: '{{default "./" .GO_MODULE_PATH}}'
8181
cmds:
8282
- |
83-
if ! which golint &>/dev/null; then
84-
echo "golint not installed or not in PATH. Please install: https://github.com/golang/lint#installation"
83+
if ! which golangci-lint &>/dev/null; then
84+
echo "golangci-lint not installed or not in PATH. Please install: https://golangci-lint.run/usage/install/"
8585
exit 1
8686
fi
8787
- |
88-
golint \
89-
{{default "-min_confidence 0.8 -set_exit_status" .GO_LINT_FLAGS}} \
90-
{{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
88+
golangci-lint run
9189
9290
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/test-go-task/Taskfile.yml
9391
go:test:
@@ -128,13 +126,6 @@ tasks:
128126
{{.TEST_LDFLAGS}}
129127
go tool covdata textfmt -i=coverage_data -o coverage_integration.txt
130128
131-
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-go-task/Taskfile.yml
132-
go:vet:
133-
desc: Check for errors in Go code
134-
dir: '{{default "./" .GO_MODULE_PATH}}'
135-
cmds:
136-
- go vet {{default .DEFAULT_GO_PACKAGES .GO_PACKAGES}}
137-
138129
go:easyjson-generate:
139130
desc: Run easyjson code generation
140131
cmds:
@@ -303,7 +294,6 @@ tasks:
303294
check:
304295
desc: Check fmt and lint
305296
cmds:
306-
- task: go:vet
307297
- task: go:lint
308298
- task: protoc:check
309299

‎arduino/builder/internal/preprocessor/internal/ctags/ctags_has_issues.go

Lines changed: 51 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -206,78 +206,76 @@ func removeComments(text string, multilinecomment bool) (string, bool) {
206206
// FindCLinkageLines scans the source files searching for "extern C" context
207207
// It save the line numbers in a map filename -> {lines...}
208208
func (p *Parser) FindCLinkageLines(tags []*Tag) map[string][]int {
209-
210209
lines := make(map[string][]int)
211210

212211
for _, tag := range tags {
213-
214212
if lines[tag.Filename] != nil {
215213
break
216214
}
217215

218216
file, err := os.Open(tag.Filename)
219-
if err == nil {
220-
defer file.Close()
217+
if err != nil {
218+
continue
219+
}
220+
lines[tag.Filename] = append(lines[tag.Filename], -1)
221221

222-
lines[tag.Filename] = append(lines[tag.Filename], -1)
222+
scanner := bufio.NewScanner(file)
223223

224-
scanner := bufio.NewScanner(file)
224+
// we can't remove the comments otherwise the line number will be wrong
225+
// there are three cases:
226+
// 1 - extern "C" void foo()
227+
// 2 - extern "C" {
228+
// void foo();
229+
// void bar();
230+
// }
231+
// 3 - extern "C"
232+
// {
233+
// void foo();
234+
// void bar();
235+
// }
236+
// case 1 and 2 can be simply recognized with string matching and indent level count
237+
// case 3 needs specia attention: if the line ONLY contains `extern "C"` string, don't bail out on indent level = 0
238+
239+
inScope := false
240+
enteringScope := false
241+
indentLevels := 0
242+
line := 0
225243

226-
// we can't remove the comments otherwise the line number will be wrong
227-
// there are three cases:
228-
// 1 - extern "C" void foo()
229-
// 2 - extern "C" {
230-
// void foo();
231-
// void bar();
232-
// }
233-
// 3 - extern "C"
234-
// {
235-
// void foo();
236-
// void bar();
237-
// }
238-
// case 1 and 2 can be simply recognized with string matching and indent level count
239-
// case 3 needs specia attention: if the line ONLY contains `extern "C"` string, don't bail out on indent level = 0
240-
241-
inScope := false
242-
enteringScope := false
243-
indentLevels := 0
244-
line := 0
245-
246-
externCDecl := removeSpacesAndTabs(keywordExternC)
247-
248-
for scanner.Scan() {
249-
line++
250-
str := removeSpacesAndTabs(scanner.Text())
244+
externCDecl := removeSpacesAndTabs(keywordExternC)
251245

252-
if len(str) == 0 {
253-
continue
254-
}
246+
for scanner.Scan() {
247+
line++
248+
str := removeSpacesAndTabs(scanner.Text())
255249

256-
// check if we are on the first non empty line after externCDecl in case 3
257-
if enteringScope {
258-
enteringScope = false
259-
}
250+
if len(str) == 0 {
251+
continue
252+
}
260253

261-
// check if the line contains externCDecl
262-
if strings.Contains(str, externCDecl) {
263-
inScope = true
264-
if len(str) == len(externCDecl) {
265-
// case 3
266-
enteringScope = true
267-
}
268-
}
269-
if inScope {
270-
lines[tag.Filename] = append(lines[tag.Filename], line)
271-
}
272-
indentLevels += strings.Count(str, "{") - strings.Count(str, "}")
254+
// check if we are on the first non empty line after externCDecl in case 3
255+
if enteringScope {
256+
enteringScope = false
257+
}
273258

274-
// Bail out if indentLevel is zero and we are not in case 3
275-
if indentLevels == 0 && !enteringScope {
276-
inScope = false
259+
// check if the line contains externCDecl
260+
if strings.Contains(str, externCDecl) {
261+
inScope = true
262+
if len(str) == len(externCDecl) {
263+
// case 3
264+
enteringScope = true
277265
}
278266
}
267+
if inScope {
268+
lines[tag.Filename] = append(lines[tag.Filename], line)
269+
}
270+
indentLevels += strings.Count(str, "{") - strings.Count(str, "}")
271+
272+
// Bail out if indentLevel is zero and we are not in case 3
273+
if indentLevels == 0 && !enteringScope {
274+
inScope = false
275+
}
279276
}
280277

278+
file.Close()
281279
}
282280
return lines
283281
}

‎arduino/builder/internal/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func ExecCommand(
277277
return verboseInfoBuf.Bytes(), stdoutBuffer.Bytes(), stderrBuffer.Bytes(), errors.WithStack(err)
278278
}
279279

280-
// DirContentIsOlderThan DirContentIsOlderThan returns true if the content of the given directory is
280+
// DirContentIsOlderThan returns true if the content of the given directory is
281281
// older than target file. If extensions are given, only the files with these
282282
// extensions are tested.
283283
func DirContentIsOlderThan(dir *paths.Path, target *paths.Path, extensions ...string) (bool, error) {

‎arduino/builder/linker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (b *Builder) link() error {
5050
// and use that archives to complete the build.
5151
if len(objectFileList) > 30000 {
5252

53-
// We must create an object file for each visited directory: this is required becuase gcc-ar checks
53+
// We must create an object file for each visited directory: this is required because gcc-ar checks
5454
// if an object file is already in the archive by looking ONLY at the filename WITHOUT the path, so
5555
// it may happen that a subdir/spi.o inside the archive may be overwritten by a anotherdir/spi.o
5656
// because thery are both named spi.o.

‎arduino/builder/sketch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func (b *Builder) sketchCopyAdditionalFiles(buildPath *paths.Path, overrides map
140140
sourceBytes = s
141141
}
142142

143-
// tag each addtional file with the filename of the source it was copied from
143+
// tag each additional file with the filename of the source it was copied from
144144
sourceBytes = append([]byte("#line 1 "+cpp.QuoteString(file.String())+"\n"), sourceBytes...)
145145

146146
err = writeIfDifferent(sourceBytes, targetPath)

‎arduino/cores/packagemanager/package_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ func (pme *Explorer) ResolveFQBN(fqbn *cores.FQBN) (
319319
}
320320

321321
// Create the build properties map by overlaying the properties of the
322-
// referenced platform propeties, the board platform properties and the
322+
// referenced platform properties, the board platform properties and the
323323
// board specific properties.
324324
buildProperties := properties.NewMap()
325325
buildProperties.Merge(variantPlatformRelease.Properties)

‎arduino/discovery/discovery.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import (
3232
"github.com/sirupsen/logrus"
3333
)
3434

35-
// To work correctly a Pluggable Discovery must respect the state machine specifed on the documentation:
35+
// To work correctly a Pluggable Discovery must respect the state machine specified on the documentation:
3636
// https://arduino.github.io/arduino-cli/latest/pluggable-discovery-specification/#state-machine
3737
// States a PluggableDiscovery can be in
3838
const (
@@ -85,7 +85,7 @@ func (msg discoveryMessage) String() string {
8585
return s
8686
}
8787

88-
// Port containts metadata about a port to connect to a board.
88+
// Port contains metadata about a port to connect to a board.
8989
type Port struct {
9090
Address string `json:"address"`
9191
AddressLabel string `json:"label"`
@@ -149,7 +149,7 @@ func (p *Port) Clone() *Port {
149149
if p == nil {
150150
return nil
151151
}
152-
var res Port = *p
152+
res := *p
153153
if p.Properties != nil {
154154
res.Properties = p.Properties.Clone()
155155
}
@@ -194,7 +194,7 @@ func (disc *PluggableDiscovery) jsonDecodeLoop(in io.Reader, outChan chan<- *dis
194194

195195
for {
196196
var msg discoveryMessage
197-
if err := decoder.Decode(&msg); err == io.EOF {
197+
if err := decoder.Decode(&msg); errors.Is(err, io.EOF) {
198198
// This is fine, we exit gracefully
199199
disc.statusMutex.Lock()
200200
disc.state = Dead

‎arduino/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ func (e *SignatureVerificationFailedError) ToRPCStatus() *status.Status {
830830

831831
// MultiplePlatformsError is returned when trying to detect
832832
// the Platform the user is trying to interact with and
833-
// and multiple results are found.
833+
// multiple results are found.
834834
type MultiplePlatformsError struct {
835835
Platforms []string
836836
UserPlatform string

‎arduino/globals/globals.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ package globals
1717

1818
var (
1919
// MainFileValidExtension is the extension that must be used for files in new sketches
20-
MainFileValidExtension string = ".ino"
20+
MainFileValidExtension = ".ino"
2121

2222
// MainFileValidExtensions lists valid extensions for a sketch file
2323
MainFileValidExtensions = map[string]bool{

‎arduino/libraries/libraries.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (library *Library) ToRPCLibrary() (*rpc.Library, error) {
106106
return p.String()
107107
}
108108

109-
// If the the "includes" property is empty or not included in the "library.properties" file
109+
// If the "includes" property is empty or not included in the "library.properties" file
110110
// we search for headers by reading the library files directly
111111
headers := library.DeclaredHeaders()
112112
if len(headers) == 0 {

‎client_example/main.go

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package main
1818
import (
1919
"bytes"
2020
"context"
21+
"errors"
2122
"fmt"
2223
"io"
2324
"log"
@@ -31,6 +32,7 @@ import (
3132
dbg "github.com/arduino/arduino-cli/rpc/cc/arduino/cli/debug/v1"
3233
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/settings/v1"
3334
"google.golang.org/grpc"
35+
"google.golang.org/grpc/credentials/insecure"
3436
)
3537

3638
var (
@@ -43,7 +45,7 @@ func main() {
4345

4446
// Establish a connection with the gRPC server, started with the command:
4547
// arduino-cli daemon
46-
conn, err := grpc.Dial("localhost:50051", grpc.WithInsecure(), grpc.WithBlock())
48+
conn, err := grpc.Dial("localhost:50051", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
4749
if err != nil {
4850
log.Fatal("error connecting to arduino-cli rpc server, you can start it by running `arduino-cli daemon`")
4951
}
@@ -352,7 +354,7 @@ func initInstance(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance) {
352354
for {
353355
res, err := stream.Recv()
354356
// Server has finished sending
355-
if err == io.EOF {
357+
if errors.Is(err, io.EOF) {
356358
break
357359
}
358360

@@ -388,7 +390,7 @@ func callUpdateIndex(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance
388390
uiResp, err := uiRespStream.Recv()
389391

390392
// the server is done
391-
if err == io.EOF {
393+
if errors.Is(err, io.EOF) {
392394
log.Print("Update index done")
393395
break
394396
}
@@ -441,7 +443,7 @@ func callPlatformInstall(client rpc.ArduinoCoreServiceClient, instance *rpc.Inst
441443
installResp, err := installRespStream.Recv()
442444

443445
// The server is done.
444-
if err == io.EOF {
446+
if errors.Is(err, io.EOF) {
445447
log.Printf("Install done")
446448
break
447449
}
@@ -495,7 +497,7 @@ func callPlatformUpgrade(client rpc.ArduinoCoreServiceClient, instance *rpc.Inst
495497
upgradeResp, err := upgradeRespStream.Recv()
496498

497499
// The server is done.
498-
if err == io.EOF {
500+
if errors.Is(err, io.EOF) {
499501
log.Printf("Upgrade done")
500502
break
501503
}
@@ -568,7 +570,7 @@ func callCompile(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance) {
568570
compResp, err := compRespStream.Recv()
569571

570572
// The server is done.
571-
if err == io.EOF {
573+
if errors.Is(err, io.EOF) {
572574
log.Print("Compilation done")
573575
break
574576
}
@@ -608,7 +610,7 @@ func callUpload(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance) {
608610

609611
for {
610612
uplResp, err := uplRespStream.Recv()
611-
if err == io.EOF {
613+
if errors.Is(err, io.EOF) {
612614
log.Printf("Upload done")
613615
break
614616
}
@@ -667,7 +669,7 @@ func callBoardListWatch(client rpc.ArduinoCoreServiceClient, instance *rpc.Insta
667669
go func() {
668670
for {
669671
res, err := watchClient.Recv()
670-
if err == io.EOF {
672+
if errors.Is(err, io.EOF) {
671673
log.Print("closing board watch connection")
672674
return
673675
} else if err != nil {
@@ -688,7 +690,7 @@ func callBoardListWatch(client rpc.ArduinoCoreServiceClient, instance *rpc.Insta
688690
}()
689691

690692
// Watch for 10 seconds and then interrupts
691-
timer := time.NewTicker(time.Duration(10 * time.Second))
693+
timer := time.NewTicker(10 * time.Second)
692694
<-timer.C
693695
}
694696

@@ -707,7 +709,7 @@ func callPlatformUnInstall(client rpc.ArduinoCoreServiceClient, instance *rpc.In
707709
// Loop and consume the server stream until all the operations are done.
708710
for {
709711
uninstallResp, err := uninstallRespStream.Recv()
710-
if err == io.EOF {
712+
if errors.Is(err, io.EOF) {
711713
log.Print("Uninstall done")
712714
break
713715
}
@@ -733,7 +735,7 @@ func callUpdateLibraryIndex(client rpc.ArduinoCoreServiceClient, instance *rpc.I
733735
// Loop and consume the server stream until all the operations are done.
734736
for {
735737
resp, err := libIdxUpdateStream.Recv()
736-
if err == io.EOF {
738+
if errors.Is(err, io.EOF) {
737739
log.Print("Library index update done")
738740
break
739741
}
@@ -763,7 +765,7 @@ func callLibDownload(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance
763765
// Loop and consume the server stream until all the operations are done.
764766
for {
765767
downloadResp, err := downloadRespStream.Recv()
766-
if err == io.EOF {
768+
if errors.Is(err, io.EOF) {
767769
log.Print("Lib download done")
768770
break
769771
}
@@ -792,7 +794,7 @@ func callLibInstall(client rpc.ArduinoCoreServiceClient, instance *rpc.Instance,
792794

793795
for {
794796
installResp, err := installRespStream.Recv()
795-
if err == io.EOF {
797+
if errors.Is(err, io.EOF) {
796798
log.Print("Lib install done")
797799
break
798800
}
@@ -825,7 +827,7 @@ func callLibInstallNoDeps(client rpc.ArduinoCoreServiceClient, instance *rpc.Ins
825827

826828
for {
827829
installResp, err := installRespStream.Recv()
828-
if err == io.EOF {
830+
if errors.Is(err, io.EOF) {
829831
log.Print("Lib install done")
830832
break
831833
}
@@ -854,7 +856,7 @@ func callLibUpgradeAll(client rpc.ArduinoCoreServiceClient, instance *rpc.Instan
854856

855857
for {
856858
resp, err := libUpgradeAllRespStream.Recv()
857-
if err == io.EOF {
859+
if errors.Is(err, io.EOF) {
858860
log.Printf("Lib upgrade all done")
859861
break
860862
}
@@ -938,7 +940,7 @@ func callLibUninstall(client rpc.ArduinoCoreServiceClient, instance *rpc.Instanc
938940

939941
for {
940942
uninstallResp, err := libUninstallRespStream.Recv()
941-
if err == io.EOF {
943+
if errors.Is(err, io.EOF) {
942944
log.Printf("Lib uninstall done")
943945
break
944946
}

‎commands/daemon/stream.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
package daemon
1717

1818
import (
19+
"errors"
1920
"io"
2021
"sync"
2122
"time"
@@ -84,7 +85,7 @@ func consumeStreamFrom(reader func() ([]byte, error)) io.Reader {
8485
go func() {
8586
for {
8687
if data, err := reader(); err != nil {
87-
if err == io.EOF {
88+
if errors.Is(err, io.EOF) {
8889
w.Close()
8990
} else {
9091
w.CloseWithError(err)

‎commands/daemon/term_example/main.go

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ import (
2525

2626
"github.com/arduino/arduino-cli/rpc/cc/arduino/cli/commands/v1"
2727
"google.golang.org/grpc"
28+
"google.golang.org/grpc/credentials/insecure"
2829
)
2930

3031
// This program exercise CLI monitor functionality.
3132

3233
func main() {
33-
conn, err := grpc.Dial("localhost:50051", grpc.WithInsecure(), grpc.WithBlock())
34+
conn, err := grpc.Dial("localhost:50051", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
3435
if err != nil {
3536
log.Fatal("error connecting to arduino-cli rpc server, you can start it by running `arduino-cli daemon`")
3637
}
@@ -39,39 +40,37 @@ func main() {
3940
// Create and initialize a CLI instance
4041
cli := commands.NewArduinoCoreServiceClient(conn)
4142

42-
var instance *commands.Instance
43-
if resp, err := cli.Create(context.Background(), &commands.CreateRequest{}); err != nil {
43+
resp, err := cli.Create(context.Background(), &commands.CreateRequest{})
44+
if err != nil {
4445
log.Fatal("Create:", err)
45-
} else {
46-
instance = resp.Instance
4746
}
47+
instance := resp.Instance
4848

49-
if respStream, err := cli.Init(context.Background(), &commands.InitRequest{Instance: instance}); err != nil {
49+
respStream, err := cli.Init(context.Background(), &commands.InitRequest{Instance: instance})
50+
if err != nil {
5051
log.Fatal("Init:", err)
51-
} else {
52-
for {
53-
resp, err := respStream.Recv()
54-
if errors.Is(err, io.EOF) {
55-
break
56-
}
57-
if err != nil {
58-
log.Fatal("Init:", err)
59-
}
60-
fmt.Println(resp)
52+
}
53+
for {
54+
resp, err := respStream.Recv()
55+
if errors.Is(err, io.EOF) {
56+
break
57+
}
58+
if err != nil {
59+
log.Fatal("Init:", err)
6160
}
61+
fmt.Println(resp)
6262
}
6363

6464
// List boards and take the first available port
65-
var port *commands.Port
66-
if resp, err := cli.BoardList(context.Background(), &commands.BoardListRequest{Instance: instance}); err != nil {
65+
respList, err := cli.BoardList(context.Background(), &commands.BoardListRequest{Instance: instance})
66+
if err != nil {
6767
log.Fatal("BoardList:", err)
68-
} else {
69-
ports := resp.GetPorts()
70-
if len(ports) == 0 {
71-
log.Fatal("No port to connect!")
72-
}
73-
port = ports[0].Port
7468
}
69+
ports := respList.GetPorts()
70+
if len(ports) == 0 {
71+
log.Fatal("No port to connect!")
72+
}
73+
port := ports[0].Port
7574
fmt.Println("Detected port:", port.Label, port.ProtocolLabel)
7675

7776
connectToPort(cli, instance, port)

‎commands/debug/debug.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,11 @@ func Debug(ctx context.Context, req *dbg.DebugConfigRequest, inStream io.Reader,
9191
if interrupt != nil {
9292
go func() {
9393
for {
94-
if sig, ok := <-interrupt; !ok {
94+
sig, ok := <-interrupt
95+
if !ok {
9596
break
96-
} else {
97-
cmd.Signal(sig)
9897
}
98+
cmd.Signal(sig)
9999
}
100100
}()
101101
}

‎executils/process.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func (p *Process) Run() error {
157157
return p.cmd.Run()
158158
}
159159

160-
// SetEnvironment set the enviroment for the running process. Each entry is of the form "key=value".
160+
// SetEnvironment set the environment for the running process. Each entry is of the form "key=value".
161161
// System default environments will be wiped out.
162162
func (p *Process) SetEnvironment(values []string) {
163163
p.cmd.Env = append([]string{}, values...)

‎internal/cli/arguments/port.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (p *Port) GetPort(instance *rpc.Instance, defaultAddress, defaultProtocol s
7979
if address == "" {
8080
// If no address is provided we assume the user is trying to upload
8181
// to a board that supports a tool that automatically detects
82-
// the attached board without specifying explictly a port.
82+
// the attached board without specifying explicitly a port.
8383
// Tools that work this way must be specified using the property
8484
// "BOARD_ID.upload.tool.default" in the platform's boards.txt.
8585
return &rpc.Port{

‎internal/cli/cli_test.go

Lines changed: 0 additions & 107 deletions
This file was deleted.

‎internal/cli/feedback/feedback.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const (
4343
YAML
4444
)
4545

46-
var formats map[string]OutputFormat = map[string]OutputFormat{
46+
var formats = map[string]OutputFormat{
4747
"json": JSON,
4848
"jsonmini": MinifiedJSON,
4949
"yaml": YAML,

‎internal/cli/lib/check_deps.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func (dr checkDepResult) String() string {
8282
res := ""
8383
deps := dr.deps.Dependencies
8484

85-
// Sort depedencies alphabetically and then puts installed ones on top
85+
// Sort dependencies alphabetically and then puts installed ones on top
8686
sort.Slice(deps, func(i, j int) bool {
8787
return deps[i].Name < deps[j].Name
8888
})

‎internal/cli/updater/updater.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ func getLatestRelease() string {
124124
// Get redirected URL
125125
location := res.Request.URL.String()
126126

127-
// The location header points to the the latest release of the CLI, it's supposed to be formatted like this:
127+
// The location header points to the latest release of the CLI, it's supposed to be formatted like this:
128128
// https://downloads.arduino.cc/arduino-cli/arduino-cli_0.18.3_Linux_64bit.tar.gz
129129
// so we split it to get the version, if there are not enough splits something must have gone wrong.
130130
split := strings.Split(location, "_")

‎internal/integrationtest/arduino-cli.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"bytes"
2020
"context"
2121
"encoding/json"
22+
"errors"
2223
"fmt"
2324
"io"
2425
"os"
@@ -34,6 +35,7 @@ import (
3435
"github.com/fatih/color"
3536
"github.com/stretchr/testify/require"
3637
"google.golang.org/grpc"
38+
"google.golang.org/grpc/credentials/insecure"
3739
)
3840

3941
// FindRepositoryRootPath returns the repository root path
@@ -265,7 +267,7 @@ func (cli *ArduinoCLI) StartDaemon(verbose bool) string {
265267
cli.proc = cliProc
266268
cli.daemonAddr = "127.0.0.1:50051"
267269

268-
copy := func(dst io.Writer, src io.Reader) {
270+
_copy := func(dst io.Writer, src io.Reader) {
269271
buff := make([]byte, 1024)
270272
for {
271273
n, err := src.Read(buff)
@@ -275,9 +277,9 @@ func (cli *ArduinoCLI) StartDaemon(verbose bool) string {
275277
dst.Write([]byte(color.YellowString(string(buff[:n]))))
276278
}
277279
}
278-
go copy(os.Stdout, stdout)
279-
go copy(os.Stderr, stderr)
280-
conn, err := grpc.Dial(cli.daemonAddr, grpc.WithInsecure(), grpc.WithBlock())
280+
go _copy(os.Stdout, stdout)
281+
go _copy(os.Stderr, stderr)
282+
conn, err := grpc.Dial(cli.daemonAddr, grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())
281283
cli.t.NoError(err)
282284
cli.daemonConn = conn
283285
cli.daemonClient = commands.NewArduinoCoreServiceClient(conn)
@@ -336,7 +338,7 @@ func (inst *ArduinoCLIInstance) Init(profile string, sketchPath string, respCB f
336338
}
337339
for {
338340
msg, err := initClient.Recv()
339-
if err == io.EOF {
341+
if errors.Is(err, io.EOF) {
340342
logCallf("<<< Init EOF\n")
341343
return nil
342344
}

‎internal/integrationtest/compile_2/compile_propeties_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ func TestCompileAndUploadRuntimeProperties(t *testing.T) {
4141
_, _, err = cli.Run("core", "install", "arduino:avr")
4242
require.NoError(t, err)
4343

44-
// Check compile runtime propeties expansion
44+
// Check compile runtime properties expansion
4545
bareMinimum := cli.CopySketch("bare_minimum")
4646
stdout, _, err := cli.Run("compile", "--fqbn", "foo:avr:bar", "-v", bareMinimum.String())
4747
require.NoError(t, err)
4848
require.Contains(t, string(stdout), "PREBUILD-runtime.hardware.path="+sketchbookHardwareDir.String())
4949

50-
// Check upload runtime propeties expansion
50+
// Check upload runtime properties expansion
5151
stdout, _, err = cli.Run("upload", "--fqbn", "foo:avr:bar", bareMinimum.String())
5252
require.NoError(t, err)
5353
require.Contains(t, string(stdout), "UPLOAD-runtime.hardware.path="+sketchbookHardwareDir.String())

‎internal/integrationtest/compile_2/compile_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ func TestCompileWithConflictingLibrariesInclude(t *testing.T) {
237237
}
238238

239239
func TestCompileWithEsp32BundledLibraries(t *testing.T) {
240-
// Some esp cores have have bundled libraries that are optimize for that architecture,
240+
// Some esp cores have bundled libraries that are optimize for that architecture,
241241
// it might happen that if the user has a library with the same name installed conflicts
242242
// can ensue and the wrong library is used for compilation, thus it fails.
243243
// This happens because for "historical" reasons these platform have their "name" key
@@ -283,7 +283,7 @@ func TestCompileWithEsp32BundledLibraries(t *testing.T) {
283283
}
284284

285285
func TestCompileWithEsp8266BundledLibraries(t *testing.T) {
286-
// Some esp cores have have bundled libraries that are optimize for that architecture,
286+
// Some esp cores have bundled libraries that are optimize for that architecture,
287287
// it might happen that if the user has a library with the same name installed conflicts
288288
// can ensue and the wrong library is used for compilation, thus it fails.
289289
// This happens because for "historical" reasons these platform have their "name" key

‎internal/integrationtest/core/core_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ func TestCoreListAllManuallyInstalledCore(t *testing.T) {
464464
stdout, _, err := cli.Run("core", "list", "--all", "--format", "json")
465465
require.NoError(t, err)
466466
requirejson.NotEmpty(t, stdout)
467-
len, err := strconv.Atoi(requirejson.Parse(t, stdout).Query("length").String())
467+
length, err := strconv.Atoi(requirejson.Parse(t, stdout).Query("length").String())
468468
require.NoError(t, err)
469469

470470
// Manually installs a core in sketchbooks hardware folder
@@ -479,7 +479,7 @@ func TestCoreListAllManuallyInstalledCore(t *testing.T) {
479479
// Verifies manually installed core is shown
480480
stdout, _, err = cli.Run("core", "list", "--all", "--format", "json")
481481
require.NoError(t, err)
482-
requirejson.Len(t, stdout, len+1)
482+
requirejson.Len(t, stdout, length+1)
483483
requirejson.Contains(t, stdout, `[
484484
{
485485
"id": "arduino-beta-development:avr",
@@ -500,7 +500,7 @@ func TestCoreListUpdatableAllFlags(t *testing.T) {
500500
stdout, _, err := cli.Run("core", "list", "--all", "--updatable", "--format", "json")
501501
require.NoError(t, err)
502502
requirejson.NotEmpty(t, stdout)
503-
len, err := strconv.Atoi(requirejson.Parse(t, stdout).Query("length").String())
503+
length, err := strconv.Atoi(requirejson.Parse(t, stdout).Query("length").String())
504504
require.NoError(t, err)
505505

506506
// Manually installs a core in sketchbooks hardware folder
@@ -515,7 +515,7 @@ func TestCoreListUpdatableAllFlags(t *testing.T) {
515515
// Verifies using both --updatable and --all flags --all takes precedence
516516
stdout, _, err = cli.Run("core", "list", "--all", "--updatable", "--format", "json")
517517
require.NoError(t, err)
518-
requirejson.Len(t, stdout, len+1)
518+
requirejson.Len(t, stdout, length+1)
519519
requirejson.Contains(t, stdout, `[
520520
{
521521
"id": "arduino-beta-development:avr",

‎internal/integrationtest/daemon/daemon_concurrency_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package daemon_test
1717

1818
import (
1919
"context"
20+
"errors"
2021
"fmt"
2122
"io"
2223
"testing"
@@ -52,7 +53,7 @@ func TestArduinoCliDaemonCompileWithLotOfOutput(t *testing.T) {
5253
msgCount := 0
5354
for {
5455
_, err := compile.Recv()
55-
if err == io.EOF {
56+
if errors.Is(err, io.EOF) {
5657
break
5758
}
5859
msgCount++

‎internal/integrationtest/daemon/daemon_test.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package daemon_test
1717

1818
import (
1919
"context"
20+
"errors"
2021
"fmt"
2122
"io"
2223
"testing"
@@ -64,7 +65,7 @@ func TestArduinoCliDaemon(t *testing.T) {
6465
go func() {
6566
for {
6667
msg, err := watcher.Recv()
67-
if err == io.EOF {
68+
if errors.Is(err, io.EOF) {
6869
fmt.Println("Watcher EOF")
6970
return
7071
}
@@ -140,7 +141,7 @@ func TestDaemonCompileOptions(t *testing.T) {
140141
require.NoError(t, err)
141142
for {
142143
msg, err := plInst.Recv()
143-
if err == io.EOF {
144+
if errors.Is(err, io.EOF) {
144145
break
145146
}
146147
require.NoError(t, err)
@@ -164,7 +165,7 @@ func TestDaemonCompileOptions(t *testing.T) {
164165
require.NoError(t, err)
165166
for {
166167
msg, err := compile.Recv()
167-
if err == io.EOF {
168+
if errors.Is(err, io.EOF) {
168169
require.FailNow(t, "Expected compilation failure", "compilation succeeded")
169170
break
170171
}
@@ -183,7 +184,7 @@ func TestDaemonCompileOptions(t *testing.T) {
183184
analyzer := NewTaskProgressAnalyzer(t)
184185
for {
185186
msg, err := compile.Recv()
186-
if err == io.EOF {
187+
if errors.Is(err, io.EOF) {
187188
break
188189
}
189190
require.NoError(t, err)
@@ -216,7 +217,7 @@ func TestDaemonCompileAfterFailedLibInstall(t *testing.T) {
216217
require.NoError(t, err)
217218
for {
218219
msg, err := compile.Recv()
219-
if err == io.EOF {
220+
if errors.Is(err, io.EOF) {
220221
require.FailNow(t, "Expected compilation failure", "compilation succeeded")
221222
break
222223
}
@@ -282,7 +283,7 @@ func TestDaemonBundleLibInstall(t *testing.T) {
282283
require.NoError(t, err)
283284
for {
284285
msg, err := instCl.Recv()
285-
if err == io.EOF {
286+
if errors.Is(err, io.EOF) {
286287
break
287288
}
288289
require.NoError(t, err)
@@ -312,7 +313,7 @@ func TestDaemonBundleLibInstall(t *testing.T) {
312313
require.NoError(t, err)
313314
for {
314315
msg, err := instCl.Recv()
315-
if err == io.EOF {
316+
if errors.Is(err, io.EOF) {
316317
break
317318
}
318319
require.NoError(t, err)
@@ -346,7 +347,7 @@ func TestDaemonBundleLibInstall(t *testing.T) {
346347
require.NoError(t, err)
347348
for {
348349
msg, err := uninstCl.Recv()
349-
if err == io.EOF {
350+
if errors.Is(err, io.EOF) {
350351
break
351352
}
352353
require.NoError(t, err)
@@ -385,7 +386,7 @@ func TestDaemonBundleLibInstall(t *testing.T) {
385386
require.NoError(t, err)
386387
for {
387388
msg, err := instCl.Recv()
388-
if err == io.EOF {
389+
if errors.Is(err, io.EOF) {
389390
require.FailNow(t, "LibraryInstall is supposed to fail because builtin libraries directory is not set")
390391
}
391392
if err != nil {
@@ -422,7 +423,7 @@ func TestDaemonLibrariesRescanOnInstall(t *testing.T) {
422423
require.NoError(t, err)
423424
for {
424425
_, err := instCl.Recv()
425-
if err == io.EOF {
426+
if errors.Is(err, io.EOF) {
426427
break
427428
}
428429
require.NoError(t, err)
@@ -455,7 +456,7 @@ func TestDaemonCoreUpgradePlatform(t *testing.T) {
455456
require.NoError(t, err)
456457
for {
457458
_, err := plInst.Recv()
458-
if err == io.EOF {
459+
if errors.Is(err, io.EOF) {
459460
break
460461
}
461462
require.NoError(t, err)
@@ -555,7 +556,7 @@ func analyzeUpdateIndexClient(t *testing.T, cl commands.ArduinoCoreService_Updat
555556
analyzer := NewDownloadProgressAnalyzer(t)
556557
for {
557558
msg, err := cl.Recv()
558-
if err == io.EOF {
559+
if errors.Is(err, io.EOF) {
559560
return analyzer.Results, nil
560561
}
561562
if err != nil {
@@ -571,7 +572,7 @@ func analyzePlatformUpgradeClient(cl commands.ArduinoCoreService_PlatformUpgrade
571572
var upgradeError error
572573
for {
573574
msg, err := cl.Recv()
574-
if err == io.EOF {
575+
if errors.Is(err, io.EOF) {
575576
break
576577
}
577578
if msg.GetPlatform() != nil {

‎internal/integrationtest/main/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestVersion(t *testing.T) {
6262
switch version := jsonMap["VersionString"]; version {
6363
case "git-snapshot":
6464
require.Contains(t, version, "git-snapshot")
65-
case "nigthly":
65+
case "nightly":
6666
require.Contains(t, version, "nightly")
6767
default:
6868
_, err = semver.Parse(version)

‎internal/integrationtest/outdated/outdated_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ func TestOutdatedUsingLibraryWithInvalidVersion(t *testing.T) {
6363
_, _, err := cli.Run("update")
6464
require.NoError(t, err)
6565

66-
// Install latest version of a library library
66+
// Install latest version of a library
6767
_, _, err = cli.Run("lib", "install", "WiFi101")
6868
require.NoError(t, err)
6969

‎internal/integrationtest/profiles/profiles_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestBuilderDidNotCatchLibsFromUnusedPlatforms(t *testing.T) {
6666
stdout, stderr, err := cli.Run("compile", "-b", "arduino:avr:uno", sketchPath.String())
6767
require.Error(t, err)
6868

69-
// check that the libary resolver did not take the SAMD bundled Wire library into account
69+
// check that the library resolver did not take the SAMD bundled Wire library into account
7070
require.NotContains(t, string(stdout), "samd")
7171
require.NotContains(t, string(stderr), "samd")
7272
}

‎internal/integrationtest/sketch/sketch_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ func TestSketchArchiveOverwrite(t *testing.T) {
412412
_, _, err = cli.Run("sketch", "archive", sketchPath.String())
413413
require.NoError(t, err)
414414

415-
// It is not possibile to override an archive by default
415+
// It is not possible to override an archive by default
416416
_, stderr, err := cli.Run("sketch", "archive", sketchPath.String())
417417
require.Error(t, err)
418418
require.Contains(t, string(stderr), "Archive already exists")

‎internal/integrationtest/upload/upload_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ func detectedBoards(t *testing.T, cli *integrationtest.ArduinoCLI) []board {
4848
var boards []board
4949
stdout, _, err := cli.Run("board", "list", "--format", "json")
5050
require.NoError(t, err)
51-
len, err := strconv.Atoi(requirejson.Parse(t, stdout).Query(".[] | .matching_boards | length").String())
51+
length, err := strconv.Atoi(requirejson.Parse(t, stdout).Query(".[] | .matching_boards | length").String())
5252
require.NoError(t, err)
53-
for i := 0; i < len; i++ {
53+
for i := 0; i < length; i++ {
5454
fqbn := strings.Trim(requirejson.Parse(t, stdout).Query(".[] | .matching_boards | .["+fmt.Sprint(i)+"] | .fqbn").String(), "\"")
5555
boards = append(boards, board{
5656
address: strings.Trim(requirejson.Parse(t, stdout).Query(".[] | .port | .address").String(), "\""),
@@ -69,10 +69,10 @@ func waitForBoard(t *testing.T, cli *integrationtest.ArduinoCLI) {
6969
for time.Now().Unix() < timeEnd {
7070
stdout, _, err := cli.Run("board", "list", "--format", "json")
7171
require.NoError(t, err)
72-
len, err := strconv.Atoi(requirejson.Parse(t, stdout).Query("length").String())
72+
length, err := strconv.Atoi(requirejson.Parse(t, stdout).Query("length").String())
7373
require.NoError(t, err)
7474
numBoards := 0
75-
for i := 0; i < len; i++ {
75+
for i := 0; i < length; i++ {
7676
numBoards, err = strconv.Atoi(requirejson.Parse(t, stdout).Query(".[] | .matching_boards | length").String())
7777
require.NoError(t, err)
7878
if numBoards > 0 {

‎internal/inventory/inventory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func Init(configPath string) error {
4848
// Attempt to read config file
4949
if err := Store.ReadInConfig(); err != nil {
5050
if _, ok := err.(viper.ConfigFileNotFoundError); !ok {
51-
// If an error occurs during initalization of the store, just log it and recreate it from scratch.
51+
// If an error occurs during initialization of the store, just log it and recreate it from scratch.
5252
logrus.WithError(err).Error("Error loading inventory store")
5353
}
5454
if err := generateInstallationData(); err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.