Skip to content

Commit

Permalink
Fix/make goimports typo error (#934)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsvisa authored Nov 25, 2020
1 parent 9127b21 commit c989f9d
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fmt:
@echo "gofmt (simplify)"
@gofmt -s -l -w $(FILES) 2>&1
@echo "goimports (if installed)"
$(shell gimports -w $(FILES) 2>/dev/null)
$(shell goimports -w $(FILES) 2>/dev/null)

tools/bin/errcheck: tools/check/go.mod
cd tools/check; \
Expand Down
2 changes: 1 addition & 1 deletion cmd/mirror.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ func newMirrorPublishCmd() *cobra.Command {
publishInfo.Stand = &standalone
publishInfo.Hide = &hidden
} else if flagSet.Exist("standalone") || flagSet.Exist("hide") {
fmt.Println("This is not a new component, --standalone and --hide flag will be omited")
fmt.Println("This is not a new component, --standalone and --hide flag will be omitted")
}

m = repository.UpdateManifestForPublish(m, component, version, entry, goos, goarch, desc, v1manifest.FileHash{
Expand Down
5 changes: 3 additions & 2 deletions components/bench/ycsb.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ package main
import (
"context"
"fmt"
"runtime"
"strings"

"github.com/magiconair/properties"
_ "github.com/pingcap/go-ycsb/db/tikv"
"github.com/pingcap/go-ycsb/pkg/client"
"github.com/pingcap/go-ycsb/pkg/measurement"
_ "github.com/pingcap/go-ycsb/pkg/workload"
"github.com/pingcap/go-ycsb/pkg/ycsb"
"github.com/spf13/cobra"
"runtime"
"strings"
)

type ycsbConfig struct {
Expand Down
5 changes: 2 additions & 3 deletions components/cluster/command/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/pingcap/tiup/pkg/errutil"
telemetry2 "github.com/pingcap/tiup/pkg/telemetry"
"github.com/pingcap/tiup/pkg/utils"
tiuputils "github.com/pingcap/tiup/pkg/utils"
"github.com/spf13/cobra"
)

Expand All @@ -47,7 +46,7 @@ var (

func newDeploy() *cobra.Command {
opt := cluster.DeployOptions{
IdentityFile: path.Join(tiuputils.UserHome(), ".ssh", "id_rsa"),
IdentityFile: path.Join(utils.UserHome(), ".ssh", "id_rsa"),
}
cmd := &cobra.Command{
Use: "deploy <cluster-name> <version> <topology.yaml>",
Expand Down Expand Up @@ -92,7 +91,7 @@ func newDeploy() *cobra.Command {
},
}

cmd.Flags().StringVarP(&opt.User, "user", "u", tiuputils.CurrentUser(), "The user name to login via SSH. The user must has root (or sudo) privilege.")
cmd.Flags().StringVarP(&opt.User, "user", "u", utils.CurrentUser(), "The user name to login via SSH. The user must has root (or sudo) privilege.")
cmd.Flags().BoolVarP(&opt.SkipCreateUser, "skip-create-user", "", false, "Skip creating the user specified in topology (experimental).")
cmd.Flags().StringVarP(&opt.IdentityFile, "identity_file", "i", opt.IdentityFile, "The path of the SSH identity file. If specified, public key authentication will be used.")
cmd.Flags().BoolVarP(&opt.UsePassword, "password", "p", false, "Use password of target hosts. If specified, password authentication will be used.")
Expand Down
2 changes: 1 addition & 1 deletion components/playground/instance/process.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type Process interface {
Cmd() *exec.Cmd
}

// process implementes Process
// process implements Process
type process struct {
cmd *exec.Cmd
startTime time.Time
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/module/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
// ShellModuleConfig is the configurations used to initialize a TiOpsModuleSystemd
type ShellModuleConfig struct {
Command string // the command to run
Sudo bool // whether use root priviledge to run the command
Sudo bool // whether use root privilege to run the command
Chdir string // change working directory before running the command
UseShell bool // whether use shell to invoke the command
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/module/systemd.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func NewSystemdModule(config SystemdModuleConfig) *SystemdModule {

switch config.Scope {
case SystemdScopeUser:
sudo = false // `--user` scope does not need root priviledge
sudo = false // `--user` scope does not need root privilege
fallthrough
case SystemdScopeGlobal:
systemctl = fmt.Sprintf("%s --%s", systemctl, config.Scope)
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/operation/operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Options struct {
Force bool // Option for upgrade subcommand
SSHTimeout uint64 // timeout in seconds when connecting an SSH server
OptTimeout uint64 // timeout in seconds for operations that support it, not to confuse with SSH timeout
APITimeout uint64 // timeout in seconds for API operations that support it, like transfering store leader
APITimeout uint64 // timeout in seconds for API operations that support it, like transferring store leader
IgnoreConfigCheck bool // should we ignore the config check result after init config
NativeSSH bool // should use native ssh client or builtin easy ssh (deprecated, shoule use SSHType)
SSHType executor.SSHType // the ssh type: 'builtin', 'system', 'none'
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/server_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const (
migrateLockName = "tiup-migrate.lck"
)

// ErrorCheckConfig represent error occured in config check stage
// ErrorCheckConfig represent error occurred in config check stage
var ErrorCheckConfig = errors.New("check config failed")

// strKeyMap tries to convert `map[interface{}]interface{}` to `map[string]interface{}`
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/spec/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ tikv_servers:
err = CheckTiKVLabels([]string{"zone", "host"}, &topo)
c.Assert(err, IsNil)

// 2 tikv on the same host with diffrent config style
// 2 tikv on the same host with different config style
topo = Specification{}
err = yaml.Unmarshal([]byte(`
tikv_servers:
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/template/install/local_install.sh.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ chmod 755 "$bin_dir/tiup"
bold=$(tput bold 2>/dev/null)
sgr0=$(tput sgr0 2>/dev/null)
# Refrence: https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix
# Reference: https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix
shell=$(echo $SHELL | awk 'BEGIN {FS="/";} { print $NF }')
echo "Detected shell: ${bold}$shell${sgr0}"
if [ -f "${HOME}/.${shell}_profile" ]; then
Expand Down
2 changes: 1 addition & 1 deletion pkg/meta/err.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func (e *ValidateErr) Is(target error) bool {
return false
}

// check for interface Value seperately
// check for interface Value separately
if e.Value != nil && t.Value != nil &&
(!reflect.ValueOf(e.Value).IsValid() && !reflect.ValueOf(t.Value).IsValid()) {
return false
Expand Down
3 changes: 0 additions & 3 deletions pkg/repository/v1manifest/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,6 @@ func SignManifest(role ValidManifest, keys ...*KeyInfo) (*Manifest, error) {
if err != nil {
return nil, errors.Trace(err)
}
if err != nil {
return nil, errors.Trace(err)
}
signs = append(signs, Signature{
KeyID: id,
Sig: sign,
Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const (
validateTagEditable = "editable"
validateTagIgnore = "ignore"
// r3labs/diff drops everything after the first ',' in the tag value, so we use a different
// seperator for the tag value and its options
// separator for the tag value and its options
validateTagSeperator = ":"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/utils/diff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ strs:
err = ValidateSpecDiff(d1, d2)
c.Assert(err, IsNil)

// add editable element (without specifing alias)
// add editable element (without specifying alias)
err = yaml.Unmarshal([]byte(`
ints: [11, 13, 12]
strs:
Expand Down
2 changes: 1 addition & 1 deletion server/handler/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var (
ErrorManifestMissing = newHandlerError(http.StatusNotFound, "MANIFEST NOT FOUND", "that component doesn't have manifest yet")
// ErrorInvalidTarball indicates that the tarball is not valid (eg. too large)
ErrorInvalidTarball = newHandlerError(http.StatusBadRequest, "INVALID TARBALL", "the tarball content is not valid")
// ErrorInvalidManifest indicates that the manfiest is not valid
// ErrorInvalidManifest indicates that the manifest is not valid
ErrorInvalidManifest = newHandlerError(http.StatusBadRequest, "INVALID MANIFEST", "the manifest content is not valid")
// ErrorInternalError indicates that an internal error happened
ErrorInternalError = newHandlerError(http.StatusInternalServerError, "INTERNAL ERROR", "an internal error happened")
Expand Down
2 changes: 1 addition & 1 deletion server/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {
Message: e.Error(),
}
}
log.Debugf("Unknow error occured: %s", err.Error())
log.Debugf("Unknow error occurred: %s", err.Error())
return &errorMessage{
Status: "UNKNOWN_ERROR",
Message: "make sure your request is valid",
Expand Down

0 comments on commit c989f9d

Please sign in to comment.