feat: go module change
This commit is contained in:
parent
7c39aad1ac
commit
ead8d89d2d
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/build"
|
"github.com/RickLeee/goc/v2/pkg/build"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/build"
|
"github.com/RickLeee/goc/v2/pkg/build"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/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"
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/client"
|
"github.com/RickLeee/goc/v2/pkg/client"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/build"
|
"github.com/RickLeee/goc/v2/pkg/build"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/qiniu/goc/v2/pkg/server"
|
"github.com/RickLeee/goc/v2/pkg/server"
|
||||||
"github.com/qiniu/goc/v2/pkg/server/store"
|
"github.com/RickLeee/goc/v2/pkg/server/store"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/pkg/client"
|
"github.com/RickLeee/goc/v2/pkg/client"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
cli "github.com/qiniu/goc/v2/pkg/watch"
|
cli "github.com/RickLeee/goc/v2/pkg/watch"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
|||||||
module github.com/qiniu/goc/v2
|
module github.com/RickLeee/goc/v2
|
||||||
|
|
||||||
go 1.16
|
go 1.16
|
||||||
|
|
||||||
|
2
main.go
2
main.go
@ -14,7 +14,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/qiniu/goc/v2/cmd"
|
"github.com/RickLeee/goc/v2/cmd"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -53,7 +53,6 @@ type Build struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// NewBuild creates a Build struct
|
// NewBuild creates a Build struct
|
||||||
//
|
|
||||||
func NewBuild(opts ...gocOption) *Build {
|
func NewBuild(opts ...gocOption) *Build {
|
||||||
b := &Build{}
|
b := &Build{}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"github.com/spf13/pflag"
|
"github.com/spf13/pflag"
|
||||||
)
|
)
|
||||||
|
@ -23,7 +23,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
// readProjectMetaInfo reads all meta informations of the corresponding project
|
// readProjectMetaInfo reads all meta informations of the corresponding project
|
||||||
|
@ -19,9 +19,9 @@ import (
|
|||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/build/internal/tool"
|
"github.com/RickLeee/goc/v2/pkg/build/internal/tool"
|
||||||
"github.com/qiniu/goc/v2/pkg/build/internal/websocket"
|
"github.com/RickLeee/goc/v2/pkg/build/internal/websocket"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/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
|
||||||
@ -127,14 +127,14 @@ func (b *Build) getPkgTmpDir(pkgDir string) string {
|
|||||||
|
|
||||||
// injectGocAgent inject handlers like following
|
// injectGocAgent inject handlers like following
|
||||||
//
|
//
|
||||||
// - xxx.go
|
// - xxx.go
|
||||||
// - yyy_package
|
// - yyy_package
|
||||||
// - main.go
|
// - main.go
|
||||||
// - goc-cover-agent-apis-auto-generated-11111-22222-bridge.go
|
// - goc-cover-agent-apis-auto-generated-11111-22222-bridge.go
|
||||||
// - goc-cover-agent-apis-auto-generated-11111-22222-package
|
// - goc-cover-agent-apis-auto-generated-11111-22222-package
|
||||||
// |
|
// |
|
||||||
// -- rpcagent.go
|
// -- rpcagent.go
|
||||||
// -- watchagent.go
|
// -- watchagent.go
|
||||||
//
|
//
|
||||||
// 11111_22222_bridge.go 仅仅用于引用 11111_22222_package, where package contains ws agent main logic.
|
// 11111_22222_bridge.go 仅仅用于引用 11111_22222_package, where package contains ws agent main logic.
|
||||||
// 使用 bridge.go 文件是为了避免插桩逻辑中的变量名污染 main 包
|
// 使用 bridge.go 文件是为了避免插桩逻辑中的变量名污染 main 包
|
||||||
|
@ -17,7 +17,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewInstall(opts ...gocOption) *Build {
|
func NewInstall(opts ...gocOption) *Build {
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log" // QINIU
|
"github.com/RickLeee/goc/v2/pkg/log" // QINIU
|
||||||
// "cmd/internal/edit"
|
// "cmd/internal/edit"
|
||||||
// "cmd/internal/objabi"
|
// "cmd/internal/objabi"
|
||||||
)
|
)
|
||||||
@ -437,7 +437,7 @@ func (f *File) newCounter(start, end token.Pos, numStmt int) string {
|
|||||||
// S1
|
// S1
|
||||||
// if cond {
|
// if cond {
|
||||||
// S2
|
// S2
|
||||||
// }
|
// }
|
||||||
// S3
|
// S3
|
||||||
//
|
//
|
||||||
// counters will be added before S1 and before S3. The block containing S2
|
// counters will be added before S1 and before S3. The block containing S2
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed websocket.tar
|
//go:embed websocket.tar
|
||||||
|
@ -18,10 +18,10 @@ import (
|
|||||||
"os/exec"
|
"os/exec"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/server"
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/server/store"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
"github.com/qiniu/goc/v2/pkg/server"
|
|
||||||
"github.com/qiniu/goc/v2/pkg/server/store"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewRun(opts ...gocOption) *Build {
|
func NewRun(opts ...gocOption) *Build {
|
||||||
|
@ -21,7 +21,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/tongjingran/copy"
|
"github.com/tongjingran/copy"
|
||||||
"golang.org/x/mod/modfile"
|
"golang.org/x/mod/modfile"
|
||||||
)
|
)
|
||||||
|
@ -16,9 +16,9 @@ package client
|
|||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/client/rest"
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
"github.com/qiniu/goc/v2/pkg/client/rest"
|
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -27,8 +27,8 @@ import (
|
|||||||
|
|
||||||
"golang.org/x/term"
|
"golang.org/x/term"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/olekukonko/tablewriter"
|
"github.com/olekukonko/tablewriter"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Action provides methods to contact with the covered agent under test
|
// Action provides methods to contact with the covered agent under test
|
||||||
|
@ -20,9 +20,9 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/qiniu/goc/v2/pkg/client/rest"
|
"github.com/RickLeee/goc/v2/pkg/client/rest"
|
||||||
"github.com/qiniu/goc/v2/pkg/client/rest/profile"
|
"github.com/RickLeee/goc/v2/pkg/client/rest/profile"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
"github.com/RickLeee/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) {
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
package rest
|
package rest
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/client/rest/agent"
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/client/rest/profile"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
"github.com/qiniu/goc/v2/pkg/client/rest/agent"
|
|
||||||
"github.com/qiniu/goc/v2/pkg/client/rest/profile"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// V2Client provides methods contact with the covered agent under test
|
// V2Client provides methods contact with the covered agent under test
|
||||||
|
@ -22,8 +22,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
"golang.org/x/tools/cover"
|
"golang.org/x/tools/cover"
|
||||||
"k8s.io/test-infra/gopherage/pkg/cov"
|
"k8s.io/test-infra/gopherage/pkg/cov"
|
||||||
)
|
)
|
||||||
|
@ -22,8 +22,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// serveRpcStream holds connection between goc server and agent.
|
// serveRpcStream holds connection between goc server and agent.
|
||||||
|
@ -25,10 +25,10 @@ import (
|
|||||||
"sync/atomic"
|
"sync/atomic"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/server/store"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
"github.com/qiniu/goc/v2/pkg/server/store"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// gocServer represents a goc server
|
// gocServer represents a goc server
|
||||||
|
@ -18,9 +18,9 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (gs *gocServer) serveWatchInternalStream(c *gin.Context) {
|
func (gs *gocServer) serveWatchInternalStream(c *gin.Context) {
|
||||||
|
@ -16,8 +16,8 @@ package watch
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/RickLeee/goc/v2/pkg/log"
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
"github.com/qiniu/goc/v2/pkg/log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Watch(host string) {
|
func Watch(host string) {
|
||||||
|
Loading…
Reference in New Issue
Block a user