Skip to content

Commit

Permalink
fix golangci-lint
Browse files Browse the repository at this point in the history
Signed-off-by: Keming <[email protected]>
  • Loading branch information
kemingy committed Jan 8, 2025
1 parent 91b93bb commit fb0a9fa
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ linters:
- bodyclose
- errcheck
- errorlint
- exportloopref
- copyloopvar
- gofmt
- goimports
- gosimple
Expand Down
4 changes: 2 additions & 2 deletions pkg/lang/ir/v0/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func (g generalGraph) Labels() (map[string]string, error) {
})
}

if g.RuntimeExpose != nil && len(g.RuntimeExpose) > 0 {
if len(g.RuntimeExpose) > 0 {
for _, item := range g.RuntimeExpose {
ports = append(ports, servertypes.EnvironmentPort{
Name: item.ServiceName,
Expand Down Expand Up @@ -256,7 +256,7 @@ func (g generalGraph) ExposedPorts() (map[string]struct{}, error) {
ports[fmt.Sprintf("%d/tcp", config.RStudioServerPortInContainer)] = struct{}{}
}

if g.RuntimeExpose != nil && len(g.RuntimeExpose) > 0 {
if len(g.RuntimeExpose) > 0 {
for _, item := range g.RuntimeExpose {
ports[fmt.Sprintf("%d/tcp", item.EnvdPort)] = struct{}{}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/lang/ir/v1/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (g generalGraph) Labels() (map[string]string, error) {
})
}

if g.RuntimeExpose != nil && len(g.RuntimeExpose) > 0 {
if len(g.RuntimeExpose) > 0 {
for _, item := range g.RuntimeExpose {
ports = append(ports, servertypes.EnvironmentPort{
Name: item.ServiceName,
Expand Down Expand Up @@ -273,7 +273,7 @@ func (g generalGraph) ExposedPorts() (map[string]struct{}, error) {
ports[fmt.Sprintf("%d/tcp", config.RStudioServerPortInContainer)] = struct{}{}
}

if g.RuntimeExpose != nil && len(g.RuntimeExpose) > 0 {
if len(g.RuntimeExpose) > 0 {
for _, item := range g.RuntimeExpose {
ports[fmt.Sprintf("%d/tcp", item.EnvdPort)] = struct{}{}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/progress/compileui/display.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type generalWriter struct {
phase string
trace *trace
doneCh chan bool
repeated bool
repeated bool
result *Result
lineCount int
}
Expand Down Expand Up @@ -72,7 +72,7 @@ func New(ctx context.Context, out console.File, mode string) (Writer, error) {
phase: "parse build.envd and download/cache dependencies",
trace: t,
doneCh: make(chan bool),
repeated: false,
repeated: false,
result: &Result{
plugins: make([]*PluginInfo, 0),
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/syncthing/device.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func ConnectDevices(s1 *Syncthing, s2 *Syncthing) error {

// This method can only be called when the devices are not connected
func (s *Syncthing) SetDeviceAddress(addr string) (err error) {
if s.Config.Devices == nil || len(s.Config.Devices) == 0 {
if len(s.Config.Devices) == 0 {
return fmt.Errorf("no devices found")
}
s.DeviceAddress = addr
Expand Down

0 comments on commit fb0a9fa

Please sign in to comment.