Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: linter

on:
push:
paths:
- '**.go'
- go.sum
- go.mod
branches-ignore:
- main
pull_request:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23.x'

- name: Deps cache
id: cache-go-deps
uses: actions/cache@v4
env:
cache-name: go-deps-cache
with:
path: ~/godeps
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-

- if: ${{ steps.cache-go-deps.outputs.cache-hit != 'true' }}
name: List the state of go modules
continue-on-error: true
run: go mod graph

- name: Install dependencies
run: |
go mod tidy
go mod download
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5

- name: Run golangci-lint
run: golangci-lint run

2 changes: 1 addition & 1 deletion internal/setup/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ After adding to PATH, restart your terminal or run:
highlightStyle.Render(m.shimPath),
highlightStyle.Render(fmt.Sprintf("echo 'export PATH=\"$HOME/.govm/shim:$PATH\"' >> %s", shellConfigFile)),
shellConfigFile,
highlightStyle.Render(fmt.Sprintf("export PATH=\"$HOME/.govm/shim:$PATH\"")),
highlightStyle.Render("export PATH=\"$HOME/.govm/shim:$PATH\""),
highlightStyle.Render(fmt.Sprintf("source %s", shellConfigFile)))
}

Expand Down
4 changes: 3 additions & 1 deletion internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@ func DownloadAndInstall(version GoVersion) tea.Cmd {
if runtime.GOOS != "windows" {
goBin := filepath.Join(versionDir, "bin", "go")
if _, err := os.Stat(goBin); err == nil {
os.Chmod(goBin, 0755)
if err := os.Chmod(goBin, 0755); err != nil {
return ErrMsg(fmt.Errorf("failed to set executable permissions: %v", err))
}
}
}
goBin := filepath.Join(versionDir, "bin", "go")
Expand Down
Loading