Open
Description
Consider the following Go program:
package main
import "fmt"
func main() {
const foo = "foo"
f(string(foo) + "bar")
}
func f(s string) {
fmt.Println(s)
}
I expected unconvert
to report that string(foo)
is an unnecessary conversion, but it didn't.
$ unconvert
$ echo $?
0
Is that intentional, or a missing feature?
Tested using Go 1.8beta2 and latest version of unconvert
and its depenencies:
$ go version
go version go1.8beta2 darwin/amd64
$ gostatus -v .../unconvert
github.com/mdempsky/unconvert/...
$ go list -f '{{join .Deps "\n"}}' github.com/mdempsky/unconvert | gostatus -stdin -v
github.com/kisielk/gotool/...
golang.org/x/text/...
$ golang.org/x/tools/...
$ Stash exists
$ binstale unconvert
unconvert
up to date: github.com/mdempsky/unconvert
/cc @dominikh in case this is a better fit for one of your tools.
Metadata
Assignees
Labels
No labels
Activity