Skip to content

Instantly share code, notes, and snippets.

@taji-taji
Last active September 18, 2015 09:35
Show Gist options
  • Save taji-taji/5f100e0e0b29a0879f87 to your computer and use it in GitHub Desktop.
Save taji-taji/5f100e0e0b29a0879f87 to your computer and use it in GitHub Desktop.
【Go】 go fmt でコード整形 ref: http://qiita.com/taji-taji/items/6d286bf4483a4c6ceed6
go fmt test.go
「import(」->「import (」
「func main(){」->「func main() {」
package main
import(
"strings"
"fmt"
)
type T struct{
name string // オブジェクトの名前
value int // その値
}
func main(){
sum := 0
for i:=1;i<=10;i++{
if (i > 5) {
s := "iが6以上です"
fmt.Printf("%d\n", s)
fmt.Printf("%v\n", strings.Fields(s))
}
sum += i
}
fmt.Printf("%d\n", sum)
}
package main
import (
"fmt"
"strings"
)
type T struct {
name string // オブジェクトの名前
value int // その値
}
func main() {
sum := 0
for i := 1; i <= 10; i++ {
if i > 5 {
s := "iが6以上です"
fmt.Printf("%d\n", s)
fmt.Printf("%v\n", strings.Fields(s))
}
sum += i
}
fmt.Printf("%d\n", sum)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment