Skip to content

Commit 98efa49

Browse files
committed
Fix Go Version and Code Style
- Downgrade Go version to 1.24 in CI for compatibility. - Correct typos and improve READme check naming. - Align go.mod version with CI for consistency.
1 parent 5b6d878 commit 98efa49

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ jobs:
6363
- name: Set up Go
6464
uses: actions/setup-go@v5
6565
with:
66-
go-version: "1.25.0"
67-
- name: Validate Reademde
66+
go-version: "1.24"
67+
- name: Validate README
6868
run: go build ./cmd/readmevalidation && ./readmevalidation
6969
- name: Remove build file artifact
7070
run: rm ./readmevalidation

.github/workflows/golangci-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v5
1818
- uses: actions/setup-go@v5
1919
with:
20-
go-version: stable
20+
go-version: "stable"
2121
- name: golangci-lint
2222
uses: golangci/golangci-lint-action@v8
2323
with:

cmd/readmevalidation/codermodules.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,16 @@ var (
1414
terraformSourceRe = regexp.MustCompile(`^\s*source\s*=\s*"([^"]+)"`)
1515
)
1616

17-
func normalizeModuleName(name string) string {
18-
// Normalize module names by replacing hyphens with underscores for comparison
19-
// since Terraform allows both but directory names typically use hyphens
20-
return strings.ReplaceAll(name, "-", "_")
21-
}
22-
23-
func extractNamespaceAndModuleFromPath(filePath string) (string, string, error) {
17+
func extractNamespaceAndModuleFromPath(filePath string) (namespace string, moduleName string, err error) {
2418
// Expected path format: registry/<namespace>/modules/<module-name>/README.md
2519
parts := strings.Split(filepath.Clean(filePath), string(filepath.Separator))
2620
if len(parts) < 5 || parts[0] != "registry" || parts[2] != "modules" || parts[4] != "README.md" {
27-
return "", "", xerrors.Errorf("invalid module path format: %s", filePath)
21+
err = xerrors.Errorf("invalid module path format: %s", filePath)
22+
return
2823
}
29-
namespace := parts[1]
30-
moduleName := parts[3]
31-
return namespace, moduleName, nil
24+
namespace = parts[1]
25+
moduleName = parts[3]
26+
return
3227
}
3328

3429
func validateModuleSourceURL(body string, filePath string) []error {

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module coder.com/coder-registry
22

3-
go 1.23.2
3+
go 1.24
44

55
require (
66
cdr.dev/slog v1.6.1

0 commit comments

Comments
 (0)