Skip to content

Commit

Permalink
refactor: change import path
Browse files Browse the repository at this point in the history
  • Loading branch information
voidint committed Nov 19, 2023
1 parent 531f383 commit 6c2799b
Show file tree
Hide file tree
Showing 31 changed files with 41 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GO = CGO_ENABLED=0 GO111MODULE=on GOPROXY=https://goproxy.cn,direct go
BUILD_DATE := $(shell date '+%Y-%m-%d %H:%M:%S')
GIT_BRANCH := $(shell git symbolic-ref --short -q HEAD)
GIT_COMMIT_HASH := $(shell git rev-parse HEAD|cut -c 1-8)
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)'"
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)'"


all: install test clean
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (

"github.com/fatih/color"
"github.com/urfave/cli/v2"
"github.com/voidint/g/internal/build"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/build"
"github.com/voidint/g/version"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cli/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/version"
)

func Test_ghome(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions cli/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/dixonwille/wmenu/v5"
"github.com/mholt/archiver/v3"
"github.com/urfave/cli/v2"
"github.com/voidint/g/internal/collector"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/collector"
"github.com/voidint/g/version"
)

func install(ctx *cli.Context) (err error) {
Expand Down
4 changes: 3 additions & 1 deletion cli/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package cli
import (
"fmt"
"os"
"sort"

"github.com/k0kubun/go-ansi"
"github.com/urfave/cli/v2"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/version"
)

func list(*cli.Context) (err error) {
Expand All @@ -26,6 +27,7 @@ func list(*cli.Context) (err error) {
continue
}
items = append(items, v)
sort.Sort(version.Collection(items))
}

render(installed(), items, ansi.NewAnsiStdout())
Expand Down
4 changes: 2 additions & 2 deletions cli/ls_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/k0kubun/go-ansi"
"github.com/urfave/cli/v2"
"github.com/voidint/g/internal/collector"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/collector"
"github.com/voidint/g/version"
)

const (
Expand Down
10 changes: 5 additions & 5 deletions cli/self_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (

"github.com/Masterminds/semver/v3"
"github.com/urfave/cli/v2"
"github.com/voidint/g/internal/build"
"github.com/voidint/g/internal/pkg/checksum"
"github.com/voidint/g/internal/pkg/errs"
httppkg "github.com/voidint/g/internal/pkg/http"
"github.com/voidint/g/internal/pkg/sdk/github"
"github.com/voidint/g/build"
"github.com/voidint/g/pkg/checksum"
"github.com/voidint/g/pkg/errs"
httppkg "github.com/voidint/g/pkg/http"
"github.com/voidint/g/pkg/sdk/github"
)

func selfUpdate(*cli.Context) (err error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"strings"

"github.com/PuerkitoBio/goquery"
"github.com/voidint/g/internal/pkg/errs"
httppkg "github.com/voidint/g/internal/pkg/http"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/pkg/errs"
httppkg "github.com/voidint/g/pkg/http"
"github.com/voidint/g/version"
)

// var _ collector.Collector = (*Collector)(nil)
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strings"
"unicode"

"github.com/voidint/g/internal/pkg/checksum"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/pkg/checksum"
"github.com/voidint/g/version"
)

type goFileItem struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/version"
)

func Test_getGoVersion(t *testing.T) {
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions internal/collector/collector.go → collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package collector
import (
"strings"

"github.com/voidint/g/internal/collector/aliyun"
"github.com/voidint/g/internal/collector/official"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/collector/aliyun"
"github.com/voidint/g/collector/official"
"github.com/voidint/g/version"
)

// Collector 版本信息采集器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (
"strings"

"github.com/PuerkitoBio/goquery"
"github.com/voidint/g/internal/pkg/errs"
httppkg "github.com/voidint/g/internal/pkg/http"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/pkg/errs"
httppkg "github.com/voidint/g/pkg/http"
"github.com/voidint/g/version"
)

// var _ collector.Collector = (*Collector)(nil)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (

"github.com/PuerkitoBio/goquery"
"github.com/stretchr/testify/assert"
"github.com/voidint/g/internal/pkg/checksum"
"github.com/voidint/g/internal/version"
"github.com/voidint/g/pkg/checksum"
"github.com/voidint/g/version"
)

func getCollector() (*Collector, error) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion gbb.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": "0.6.1",
"tool": "go build -v -trimpath -ldflags '-s -w'",
"importpath": "github.com/voidint/g/internal/build",
"importpath": "github.com/voidint/g/build",
"variables": [
{
"variable": "Built",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"io"
"os"

"github.com/voidint/g/internal/pkg/errs"
"github.com/voidint/g/pkg/errs"
)

// Algorithm 校验和算法
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"

"github.com/stretchr/testify/assert"
"github.com/voidint/g/internal/pkg/errs"
"github.com/voidint/g/pkg/errs"
)

func TestVerifyFile(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion internal/pkg/http/download.go → pkg/http/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/k0kubun/go-ansi"
"github.com/schollz/progressbar/v3"

"github.com/voidint/g/internal/pkg/errs"
"github.com/voidint/g/pkg/errs"
)

// Download 下载资源并另存为
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/Masterminds/semver/v3"
"github.com/mholt/archiver/v3"

"github.com/voidint/g/internal/pkg/checksum"
"github.com/voidint/g/internal/pkg/errs"
httppkg "github.com/voidint/g/internal/pkg/http"
"github.com/voidint/g/pkg/checksum"
"github.com/voidint/g/pkg/errs"
httppkg "github.com/voidint/g/pkg/http"
"github.com/voidint/go-update"
)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions internal/version/version.go → version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (
"strings"

"github.com/Masterminds/semver/v3"
"github.com/voidint/g/internal/pkg/checksum"
"github.com/voidint/g/internal/pkg/errs"
httppkg "github.com/voidint/g/internal/pkg/http"
"github.com/voidint/g/pkg/checksum"
"github.com/voidint/g/pkg/errs"
httppkg "github.com/voidint/g/pkg/http"
)

// Semantify go 版本号并未完全遵循语义化版本号标准,该函数进行了一定的适配,返回一个语义化版本。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/voidint/g/internal/pkg/errs"
"github.com/voidint/g/pkg/errs"
)

func TestFindVersion(t *testing.T) {
Expand Down

0 comments on commit 6c2799b

Please sign in to comment.