Skip to content

Commit 3023fa7

Browse files
committed
fix(backend): add go-pkg backend for go package installation and include pip-audit/govulncheck
1 parent 6253834 commit 3023fa7

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

.unirtm.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ node = '26.1.0'
155155
'npm:sort-package-json' = '3.6.1'
156156
'npm:stylelint' = '17.10.0'
157157
'pipx:clang-format' = '22.1.4'
158+
'pipx:pip-audit' = '2.8.0'
158159
'pipx:pre-commit' = '4.6.0'
159160
'pipx:yamllint' = '1.38.0'
160161
python = '3.14.4'
162+
'go:golang.org/x/vuln/cmd/govulncheck' = '1.1.4'

internal/backend/go_pkg.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright (c) 2026 SnowdreamTech. All rights reserved.
2+
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
3+
4+
package backend
5+
6+
// GoPkgBackend implements the backend for go packages.
7+
// It embeds GoBackend to reuse its version resolution logic (proxy.golang.org).
8+
type GoPkgBackend struct {
9+
*GoBackend
10+
}
11+
12+
func NewGoPkgBackend() *GoPkgBackend {
13+
return &GoPkgBackend{
14+
GoBackend: NewGoBackend(),
15+
}
16+
}
17+
18+
func (b *GoPkgBackend) Name() string {
19+
return "go-pkg"
20+
}

internal/backend/registry.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ func NewRegistry() *Registry {
4646
r.Register(NewS3Backend())
4747
r.Register(NewPipxBackend())
4848
r.Register(NewNativeBackend())
49+
r.Register(NewGoPkgBackend())
4950

5051
return r
5152
}

0 commit comments

Comments
 (0)