Skip to content

Commit 6c2799b

Browse files
committed
refactor: change import path
1 parent 531f383 commit 6c2799b

31 files changed

+41
-39
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ GO = CGO_ENABLED=0 GO111MODULE=on GOPROXY=https://goproxy.cn,direct go
22
BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
33
GIT_BRANCH := $(shell git symbolic-ref --short -q HEAD)
44
GIT_COMMIT_HASH := $(shell git rev-parse HEAD|cut -c 1-8)
5-
GO_FLAGS := -v -ldflags="-X 'github.com/voidint/g/internal/build.Built=$(BUILD_DATE)' -X 'github.com/voidint/g/internal/build.GitCommit=$(GIT_COMMIT_HASH)' -X 'github.com/voidint/g/internal/build.GitBranch=$(GIT_BRANCH)'"
5+
GO_FLAGS := -v -ldflags="-X 'github.com/voidint/g/build.Built=$(BUILD_DATE)' -X 'github.com/voidint/g/build.GitCommit=$(GIT_COMMIT_HASH)' -X 'github.com/voidint/g/build.GitBranch=$(GIT_BRANCH)'"
66

77

88
all: install test clean
File renamed without changes.

cli/cli.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010

1111
"github.com/fatih/color"
1212
"github.com/urfave/cli/v2"
13-
"github.com/voidint/g/internal/build"
14-
"github.com/voidint/g/internal/version"
13+
"github.com/voidint/g/build"
14+
"github.com/voidint/g/version"
1515
)
1616

1717
var (

cli/cli_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"time"
1212

1313
"github.com/stretchr/testify/assert"
14-
"github.com/voidint/g/internal/version"
14+
"github.com/voidint/g/version"
1515
)
1616

1717
func Test_ghome(t *testing.T) {

cli/install.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/dixonwille/wmenu/v5"
1414
"github.com/mholt/archiver/v3"
1515
"github.com/urfave/cli/v2"
16-
"github.com/voidint/g/internal/collector"
17-
"github.com/voidint/g/internal/version"
16+
"github.com/voidint/g/collector"
17+
"github.com/voidint/g/version"
1818
)
1919

2020
func install(ctx *cli.Context) (err error) {

cli/ls.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package cli
33
import (
44
"fmt"
55
"os"
6+
"sort"
67

78
"github.com/k0kubun/go-ansi"
89
"github.com/urfave/cli/v2"
9-
"github.com/voidint/g/internal/version"
10+
"github.com/voidint/g/version"
1011
)
1112

1213
func list(*cli.Context) (err error) {
@@ -26,6 +27,7 @@ func list(*cli.Context) (err error) {
2627
continue
2728
}
2829
items = append(items, v)
30+
sort.Sort(version.Collection(items))
2931
}
3032

3133
render(installed(), items, ansi.NewAnsiStdout())

cli/ls_remote.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66

77
"github.com/k0kubun/go-ansi"
88
"github.com/urfave/cli/v2"
9-
"github.com/voidint/g/internal/collector"
10-
"github.com/voidint/g/internal/version"
9+
"github.com/voidint/g/collector"
10+
"github.com/voidint/g/version"
1111
)
1212

1313
const (

cli/self_update.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99

1010
"github.com/Masterminds/semver/v3"
1111
"github.com/urfave/cli/v2"
12-
"github.com/voidint/g/internal/build"
13-
"github.com/voidint/g/internal/pkg/checksum"
14-
"github.com/voidint/g/internal/pkg/errs"
15-
httppkg "github.com/voidint/g/internal/pkg/http"
16-
"github.com/voidint/g/internal/pkg/sdk/github"
12+
"github.com/voidint/g/build"
13+
"github.com/voidint/g/pkg/checksum"
14+
"github.com/voidint/g/pkg/errs"
15+
httppkg "github.com/voidint/g/pkg/http"
16+
"github.com/voidint/g/pkg/sdk/github"
1717
)
1818

1919
func selfUpdate(*cli.Context) (err error) {

internal/collector/aliyun/aliyun_collector.go collector/aliyun/aliyun_collector.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"strings"
99

1010
"github.com/PuerkitoBio/goquery"
11-
"github.com/voidint/g/internal/pkg/errs"
12-
httppkg "github.com/voidint/g/internal/pkg/http"
13-
"github.com/voidint/g/internal/version"
11+
"github.com/voidint/g/pkg/errs"
12+
httppkg "github.com/voidint/g/pkg/http"
13+
"github.com/voidint/g/version"
1414
)
1515

1616
// var _ collector.Collector = (*Collector)(nil)

internal/collector/aliyun/go_file_item.go collector/aliyun/go_file_item.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"strings"
66
"unicode"
77

8-
"github.com/voidint/g/internal/pkg/checksum"
9-
"github.com/voidint/g/internal/version"
8+
"github.com/voidint/g/pkg/checksum"
9+
"github.com/voidint/g/version"
1010
)
1111

1212
type goFileItem struct {

internal/collector/aliyun/go_file_item_test.go collector/aliyun/go_file_item_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55

66
"github.com/stretchr/testify/assert"
7-
"github.com/voidint/g/internal/version"
7+
"github.com/voidint/g/version"
88
)
99

1010
func Test_getGoVersion(t *testing.T) {

internal/collector/collector.go collector/collector.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ package collector
33
import (
44
"strings"
55

6-
"github.com/voidint/g/internal/collector/aliyun"
7-
"github.com/voidint/g/internal/collector/official"
8-
"github.com/voidint/g/internal/version"
6+
"github.com/voidint/g/collector/aliyun"
7+
"github.com/voidint/g/collector/official"
8+
"github.com/voidint/g/version"
99
)
1010

1111
// Collector 版本信息采集器

internal/collector/official/official_collector.go collector/official/official_collector.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"strings"
99

1010
"github.com/PuerkitoBio/goquery"
11-
"github.com/voidint/g/internal/pkg/errs"
12-
httppkg "github.com/voidint/g/internal/pkg/http"
13-
"github.com/voidint/g/internal/version"
11+
"github.com/voidint/g/pkg/errs"
12+
httppkg "github.com/voidint/g/pkg/http"
13+
"github.com/voidint/g/version"
1414
)
1515

1616
// var _ collector.Collector = (*Collector)(nil)

internal/collector/official/official_collector_test.go collector/official/official_collector_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"github.com/PuerkitoBio/goquery"
99
"github.com/stretchr/testify/assert"
10-
"github.com/voidint/g/internal/pkg/checksum"
11-
"github.com/voidint/g/internal/version"
10+
"github.com/voidint/g/pkg/checksum"
11+
"github.com/voidint/g/version"
1212
)
1313

1414
func getCollector() (*Collector, error) {

gbb.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"version": "0.6.1",
33
"tool": "go build -v -trimpath -ldflags '-s -w'",
4-
"importpath": "github.com/voidint/g/internal/build",
4+
"importpath": "github.com/voidint/g/build",
55
"variables": [
66
{
77
"variable": "Built",

internal/pkg/checksum/checksum.go pkg/checksum/checksum.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"io"
99
"os"
1010

11-
"github.com/voidint/g/internal/pkg/errs"
11+
"github.com/voidint/g/pkg/errs"
1212
)
1313

1414
// Algorithm 校验和算法

internal/pkg/checksum/checksum_test.go pkg/checksum/checksum_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55

66
"github.com/stretchr/testify/assert"
7-
"github.com/voidint/g/internal/pkg/errs"
7+
"github.com/voidint/g/pkg/errs"
88
)
99

1010
func TestVerifyFile(t *testing.T) {
File renamed without changes.
File renamed without changes.
File renamed without changes.

internal/pkg/http/download.go pkg/http/download.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/k0kubun/go-ansi"
1212
"github.com/schollz/progressbar/v3"
1313

14-
"github.com/voidint/g/internal/pkg/errs"
14+
"github.com/voidint/g/pkg/errs"
1515
)
1616

1717
// Download 下载资源并另存为

internal/pkg/sdk/github/release.go pkg/sdk/github/release.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
"github.com/Masterminds/semver/v3"
1515
"github.com/mholt/archiver/v3"
1616

17-
"github.com/voidint/g/internal/pkg/checksum"
18-
"github.com/voidint/g/internal/pkg/errs"
19-
httppkg "github.com/voidint/g/internal/pkg/http"
17+
"github.com/voidint/g/pkg/checksum"
18+
"github.com/voidint/g/pkg/errs"
19+
httppkg "github.com/voidint/g/pkg/http"
2020
"github.com/voidint/go-update"
2121
)
2222

File renamed without changes.
File renamed without changes.

internal/version/version.go version/version.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66
"strings"
77

88
"github.com/Masterminds/semver/v3"
9-
"github.com/voidint/g/internal/pkg/checksum"
10-
"github.com/voidint/g/internal/pkg/errs"
11-
httppkg "github.com/voidint/g/internal/pkg/http"
9+
"github.com/voidint/g/pkg/checksum"
10+
"github.com/voidint/g/pkg/errs"
11+
httppkg "github.com/voidint/g/pkg/http"
1212
)
1313

1414
// Semantify go 版本号并未完全遵循语义化版本号标准,该函数进行了一定的适配,返回一个语义化版本。

internal/version/version_test.go version/version_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"time"
1111

1212
"github.com/stretchr/testify/assert"
13-
"github.com/voidint/g/internal/pkg/errs"
13+
"github.com/voidint/g/pkg/errs"
1414
)
1515

1616
func TestFindVersion(t *testing.T) {

0 commit comments

Comments
 (0)