Oh, I'm sorry, I first noticed it from golang playground, then noticed the
same behavior locally.
But I forgot that my Emacs code formatting ties *not only* gofmt but also
with `goimports`, where the problem really occurs.
Sorry about making the fuzz. I'll recomiple goimports as well...
On Wed,
> Have you tried with gofmt 1.9 locally before posting?
of course. that is what i showed in the original post:
$ go version
go version go1.9 darwin/amd64
$ gofmt t.go
package main
import (
"fmt"
)
type myint = int
func main() {
var ii myint = 5
fmt.Println("Hello, playground#", ii)
Works for me locally. I use both gofmt and goimports; for the latter, I had
to recompile it.
https://github.com/golang/go/issues/21645 is about updating the playground.
On Tue, Aug 29, 2017 at 9:05 PM, Tong Sun wrote:
>
>
> On Wednesday, August 30, 2017 at 12:02:28 AM UTC-4, andrey mirtchovski
On Wednesday, August 30, 2017 at 12:02:28 AM UTC-4, andrey mirtchovski
wrote:
>
> occam's razor: most likely the playground is running an old gofmt.
>
Have you tried with gofmt 1.9 locally before posting?
I have.
--
You received this message because you are subscribed to the Google Groups
occam's razor: most likely the playground is running an old gofmt.
$ gofmt t.go
package main
import (
"fmt"
)
type myint = int
func main() {
var ii myint = 5
fmt.Println("Hello, playground#", ii)
}
$ ~/go1.4/bin/gofmt t.go
t.go:7:12: expected type, found '='
...
On Tue, Aug 29, 201
Go 1.9 introduced type alias but the `gofmt` that comes with go 1.9 can't
handle type alias.
Demo here:
https://play.golang.org/p/ldzfOJfj7V
7:11: expected type, found '=' (and 1 more errors)
but it runs fine.
--
You received this message because you are subscribed to the Google Groups
"