Skip to content

Commit d5a1da5

Browse files
committed
fix: remove redundant nil check for staticcheck S1009
- Remove unnecessary nil check before len() as len(nil) returns 0 - Add golangci-lint to devbox packages
1 parent 5f4e8a3 commit d5a1da5

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

deployment/instance/state/builder.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func (b *builder) renderJobTemplates(
225225

226226
func (b *builder) defaultAddress(networkRefs []NetworkRef, agentState agentclient.AgentState) (string, error) {
227227

228-
if (networkRefs == nil) || (len(networkRefs) == 0) {
228+
if len(networkRefs) == 0 {
229229
return "", errors.New("Must specify network") //nolint:staticcheck
230230
}
231231

devbox.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.16.0/.schema/devbox.schema.json",
3+
"packages": [
4+
"go@latest",
5+
"ruby@3.4.8",
6+
"golangci-lint@latest"
7+
],
8+
"shell": {
9+
"init_hook": [
10+
"echo 'Welcome to devbox!' > /dev/null"
11+
],
12+
"scripts": {
13+
"test": [
14+
"echo \"Error: no test specified\" && exit 1"
15+
]
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)