Skip to content

Commit

Permalink
Merge pull request #5501 from tanjunchen/simplify-code-and-fix-typo
Browse files Browse the repository at this point in the history
replace strings.TrimRight with strings.TrimSuffix and fix typo
  • Loading branch information
sougou authored Dec 10, 2019
2 parents f242a24 + 7eccef6 commit 46a607e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Flags available:
go run vtcompose/vtcompose.go -keyspaceData="test_keyspace:2:1:create_messages.sql,create_tokens.sql:lookup_keyspace;lookup_keyspace:1:1:create_tokens_token_lookup.sql,create_messages_message_lookup.sql"
```
* **externalDbData** - Specifies which databases/keyspaces are external and provides data along with it to connect to the external db.
List of `<external_db_name>,<DB_HOST>,<DB_PORT>,<DB_USER>,<DB_PASS>,<DB_CHARSET>` seperated by ';'.
List of `<external_db_name>,<DB_HOST>,<DB_PORT>,<DB_USER>,<DB_PASS>,<DB_CHARSET>` separated by ';'.
When using this, make sure to have the external_db_name/keyspace in the `keyspaceData` flag with no schema_file_names specified.
```
go run vtcompose/vtcompose.go -keyspaces="test:0:2::" -externalDbData="test:192.68.99.101:3306:admin:pass:CHARACTER SET utf8 COLLATE utf8_general_ci"
Expand Down
2 changes: 1 addition & 1 deletion examples/compose/vtcompose/vtcompose.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var (
mySqlPort = flag.String("mySqlPort", "15306", "mySql port to be used")
cell = flag.String("cell", "test", "Vitess Cell name")
keyspaceData = flag.String("keyspaceData", "test_keyspace:2:1:create_messages.sql,create_tokens.sql;unsharded_keyspace:0:0:create_dinosaurs.sql,create_eggs.sql", "List of keyspace_name/external_db_name:num_of_shards:num_of_replica_tablets:schema_files:<optional>lookup_keyspace_name separated by ';'")
externalDbData = flag.String("externalDbData", "", "List of Data corresponding to external DBs. List of <external_db_name>,<DB_HOST>,<DB_PORT>,<DB_USER>,<DB_PASS>,<DB_CHARSET> seperated by ';'")
externalDbData = flag.String("externalDbData", "", "List of Data corresponding to external DBs. List of <external_db_name>,<DB_HOST>,<DB_PORT>,<DB_USER>,<DB_PASS>,<DB_CHARSET> separated by ';'")
)

type keyspaceInfo struct {
Expand Down
2 changes: 1 addition & 1 deletion go/cmd/zk/zkcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func main() {

func fixZkPath(zkPath string) string {
if zkPath != "/" {
zkPath = strings.TrimRight(zkPath, "/")
zkPath = strings.TrimSuffix(zkPath, "/")
}
return path.Clean(zkPath)
}
Expand Down
2 changes: 1 addition & 1 deletion go/netutil/netutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func FullyQualifiedHostname() (string, error) {
// 127.0.0.1 localhost.localdomain localhost
// If the FQDN isn't returned by this function, check the order in the entry
// in your /etc/hosts file.
return strings.TrimRight(resolvedHostnames[0], "."), nil
return strings.TrimSuffix(resolvedHostnames[0], "."), nil
}

// FullyQualifiedHostnameOrPanic is the same as FullyQualifiedHostname
Expand Down

0 comments on commit 46a607e

Please sign in to comment.