refactor: go module name

This commit is contained in:
liruichen_wsl 2024-11-19 11:32:10 +08:00
parent f0fbcc680a
commit 24e06870bb
33 changed files with 2249 additions and 2217 deletions

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
tests/e2e/tmp/* tests/e2e/tmp/*
.goc.kvstore .goc.kvstore
coverage.txt coverage.txt
.idea
repos

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/build" "github.com/ar0c/goc/v2/pkg/build"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/build" "github.com/ar0c/goc/v2/pkg/build"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/build" "github.com/ar0c/goc/v2/pkg/build"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"golang.org/x/tools/cover" "golang.org/x/tools/cover"
"k8s.io/test-infra/gopherage/pkg/cov" "k8s.io/test-infra/gopherage/pkg/cov"

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/client" "github.com/ar0c/goc/v2/pkg/client"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/build" "github.com/ar0c/goc/v2/pkg/build"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -14,9 +14,9 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/RickLeee/goc/v2/pkg/server" "github.com/ar0c/goc/v2/pkg/server"
"github.com/RickLeee/goc/v2/pkg/server/store" "github.com/ar0c/goc/v2/pkg/server/store"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

30
cmd/server_test.go Normal file
View File

@ -0,0 +1,30 @@
package cmd
import (
"github.com/ar0c/goc/v2/pkg/log"
"github.com/spf13/cobra"
"testing"
)
func Test_serve(t *testing.T) {
type args struct {
cmd *cobra.Command
args []string
}
tests := []struct {
name string
args args
}{
{
name: "",
args: args{},
},
// TODO: Add test cases.
}
for _, tt := range tests {
log.NewLogger(true)
t.Run(tt.name, func(t *testing.T) {
serve(tt.args.cmd, tt.args.args)
})
}
}

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
"github.com/RickLeee/goc/v2/pkg/client" "github.com/ar0c/goc/v2/pkg/client"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )

View File

@ -14,7 +14,7 @@
package cmd package cmd
import ( import (
cli "github.com/RickLeee/goc/v2/pkg/watch" cli "github.com/ar0c/goc/v2/pkg/watch"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/RickLeee/goc/v2 module github.com/ar0c/goc/v2
go 1.22.0 go 1.22.0

View File

@ -10,7 +10,7 @@ RELEASE_VERSION=$(echo $EVENT_DATA | jq -r .release.tag_name)
PROJECT_NAME=$(basename $GITHUB_REPOSITORY) PROJECT_NAME=$(basename $GITHUB_REPOSITORY)
NAME="${NAME:-${PROJECT_NAME}-${RELEASE_VERSION}}-${GOOS}-${GOARCH}" NAME="${NAME:-${PROJECT_NAME}-${RELEASE_VERSION}}-${GOOS}-${GOARCH}"
CGO_ENABLED=0 go build -o goc -ldflags "-X 'github.com/RickLeee/goc/v2/cmd.Version=${RELEASE_VERSION}'" . CGO_ENABLED=0 go build -o goc -ldflags "-X 'github.com/ar0c/goc/v2/cmd.Version=${RELEASE_VERSION}'" .
ARCHIVE=tmp.tar.gz ARCHIVE=tmp.tar.gz
FILE_LIST=goc FILE_LIST=goc

View File

@ -14,7 +14,7 @@
package main package main
import ( import (
"github.com/RickLeee/goc/v2/cmd" "github.com/ar0c/goc/v2/cmd"
) )
func main() { func main() {

View File

@ -18,7 +18,7 @@ import (
"os/exec" "os/exec"
"strings" "strings"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )

View File

@ -20,7 +20,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )

View File

@ -23,7 +23,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
) )
// readProjectMetaInfo reads all meta informations of the corresponding project // readProjectMetaInfo reads all meta informations of the corresponding project

View File

@ -21,9 +21,9 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/RickLeee/goc/v2/pkg/build/internal/tool" "github.com/ar0c/goc/v2/pkg/build/internal/tool"
"github.com/RickLeee/goc/v2/pkg/build/internal/websocket" "github.com/ar0c/goc/v2/pkg/build/internal/websocket"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
) )
// Inject injects cover variables for all the .go files in the target directory // Inject injects cover variables for all the .go files in the target directory

View File

@ -17,7 +17,7 @@ import (
"os" "os"
"os/exec" "os/exec"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
) )
func NewInstall(opts ...gocOption) *Build { func NewInstall(opts ...gocOption) *Build {

View File

@ -18,7 +18,7 @@ import (
"os" "os"
"sort" "sort"
"github.com/RickLeee/goc/v2/pkg/log" // QINIU "github.com/ar0c/goc/v2/pkg/log" // QINIU
// "cmd/internal/edit" // "cmd/internal/edit"
// "cmd/internal/objabi" // "cmd/internal/objabi"
) )

View File

@ -21,7 +21,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
) )
//go:embed websocket.tar //go:embed websocket.tar

View File

@ -18,9 +18,9 @@ import (
"os/exec" "os/exec"
"os/signal" "os/signal"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/RickLeee/goc/v2/pkg/server" "github.com/ar0c/goc/v2/pkg/server"
"github.com/RickLeee/goc/v2/pkg/server/store" "github.com/ar0c/goc/v2/pkg/server/store"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View File

@ -21,7 +21,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/tongjingran/copy" "github.com/tongjingran/copy"
"golang.org/x/mod/modfile" "golang.org/x/mod/modfile"
) )

View File

@ -18,8 +18,8 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/RickLeee/goc/v2/pkg/client/rest" "github.com/ar0c/goc/v2/pkg/client/rest"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"
) )

View File

@ -27,7 +27,7 @@ import (
"golang.org/x/term" "golang.org/x/term"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/olekukonko/tablewriter" "github.com/olekukonko/tablewriter"
) )

View File

@ -20,9 +20,9 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/RickLeee/goc/v2/pkg/client/rest" "github.com/ar0c/goc/v2/pkg/client/rest"
"github.com/RickLeee/goc/v2/pkg/client/rest/profile" "github.com/ar0c/goc/v2/pkg/client/rest/profile"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
) )
func GetProfile(host string, ids []string, skips []string, extra string, output string, need []string) { func GetProfile(host string, ids []string, skips []string, extra string, output string, need []string) {

View File

@ -14,8 +14,8 @@
package rest package rest
import ( import (
"github.com/RickLeee/goc/v2/pkg/client/rest/agent" "github.com/ar0c/goc/v2/pkg/client/rest/agent"
"github.com/RickLeee/goc/v2/pkg/client/rest/profile" "github.com/ar0c/goc/v2/pkg/client/rest/profile"
"github.com/go-resty/resty/v2" "github.com/go-resty/resty/v2"
) )

View File

@ -22,7 +22,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"golang.org/x/tools/cover" "golang.org/x/tools/cover"
"k8s.io/test-infra/gopherage/pkg/cov" "k8s.io/test-infra/gopherage/pkg/cov"

View File

@ -22,7 +22,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )

View File

@ -25,8 +25,8 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/RickLeee/goc/v2/pkg/server/store" "github.com/ar0c/goc/v2/pkg/server/store"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
) )

View File

@ -18,7 +18,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
) )

View File

@ -16,7 +16,7 @@ package watch
import ( import (
"fmt" "fmt"
"github.com/RickLeee/goc/v2/pkg/log" "github.com/ar0c/goc/v2/pkg/log"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
) )