Skip to content

Commit

Permalink
chore(admin-cli&pegic): Add make fmt and fotmat files
Browse files Browse the repository at this point in the history
  • Loading branch information
acelyc111 committed Dec 19, 2023
1 parent 2a6cc71 commit e3c3d37
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions admin-cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ build:
go mod tidy
go build -o bin/admin-cli main.go

fmt:
go fmt ./...

test:
go test -race -v -failfast -test.timeout 5m ./...
2 changes: 1 addition & 1 deletion admin-cli/cmd/remote_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/desertbit/grumble"
)

//TODO(jiashuo1) The command will be replaced by `server-config` in server_config.go
// TODO(jiashuo1) The command will be replaced by `server-config` in server_config.go
func init() {
rootCmd := &grumble.Command{
Name: "remote-command",
Expand Down
2 changes: 1 addition & 1 deletion admin-cli/executor/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type response struct {
Value string
}

//TODO(jiashuo1) not support update collector config
// TODO(jiashuo1) not support update collector config
func ConfigCommand(client *Client, nodeType session.NodeType, nodeAddr string, name string, actionType string, value string) error {
var nodes []*util.PegasusNode
if len(nodeAddr) == 0 {
Expand Down
17 changes: 9 additions & 8 deletions admin-cli/tabular/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ import (
//
// For example:
// ```
// type tableStruct struct {
// PartitionCount int `json:"partition_count"`
// TableName string `json:"name"`
// }
// var tables []tableStruct
// ...
// tabular.Print(tables)
// ```
//
// type tableStruct struct {
// PartitionCount int `json:"partition_count"`
// TableName string `json:"name"`
// }
// var tables []tableStruct
// ...
// tabular.Print(tables)
//
// ```
func New(writer io.Writer, valueList []interface{}, configurer func(*tablewriter.Table)) *tablewriter.Table {
header := getHeaderFromValueList(valueList)
tabWriter := NewTabWriter(writer, header)
Expand Down
4 changes: 2 additions & 2 deletions admin-cli/util/pegasus_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func (n *PegasusNode) RPCAddress() *base.RPCAddress {

// NewNodeFromTCPAddr creates a node from tcp address.
// NOTE:
// - Will not initialize TCP connection unless needed.
// - Should not be called too frequently because it costs 1 DNS resolution.
// - Will not initialize TCP connection unless needed.
// - Should not be called too frequently because it costs 1 DNS resolution.
func NewNodeFromTCPAddr(addr string, ntype session.NodeType) *PegasusNode {
tcpAddr, err := net.ResolveTCPAddr("tcp", addr)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions pegic/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
build:
go mod verify && go mod tidy
go build -o bin/pegic main.go

fmt:
go fmt ./...

0 comments on commit e3c3d37

Please sign in to comment.