mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 03:03:27 +00:00
all: replace strings.Replace with strings.ReplaceAll
This was an addition to Go 1.13 and results in slightly easier to read code.
This commit is contained in:
committed by
Ron Evans
parent
b0366743cd
commit
e3aa13c2a6
@@ -266,7 +266,7 @@ func Flash(pkgName, port string, options *compileopts.Options) error {
|
||||
// Create the command.
|
||||
flashCmd := config.Target.FlashCommand
|
||||
fileToken := "{" + fileExt[1:] + "}"
|
||||
flashCmd = strings.Replace(flashCmd, fileToken, result.Binary, -1)
|
||||
flashCmd = strings.ReplaceAll(flashCmd, fileToken, result.Binary)
|
||||
|
||||
if port == "" && strings.Contains(flashCmd, "{port}") {
|
||||
var err error
|
||||
@@ -276,7 +276,7 @@ func Flash(pkgName, port string, options *compileopts.Options) error {
|
||||
}
|
||||
}
|
||||
|
||||
flashCmd = strings.Replace(flashCmd, "{port}", port, -1)
|
||||
flashCmd = strings.ReplaceAll(flashCmd, "{port}", port)
|
||||
|
||||
// Execute the command.
|
||||
var cmd *exec.Cmd
|
||||
|
||||
Reference in New Issue
Block a user