Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace strings.TrimRight with strings.TrimSuffix and fix typo #5501

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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