Merge pull request #54 from zchee/format-opcode

Format opcode
This commit is contained in:
Masaaki Goshima 2020-11-13 13:31:47 +09:00 committed by GitHub
commit 897345da64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7995 additions and 7991 deletions

View File

@ -3,6 +3,7 @@ package main
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"go/format"
"io/ioutil" "io/ioutil"
"path/filepath" "path/filepath"
"runtime" "runtime"
@ -380,7 +381,11 @@ func (t opType) fieldToStringTagField() opType {
return err return err
} }
path := filepath.Join(repoRoot(), "encode_optype.go") path := filepath.Join(repoRoot(), "encode_optype.go")
return ioutil.WriteFile(path, b.Bytes(), 0644) buf, err := format.Source(b.Bytes())
if err != nil {
return err
}
return ioutil.WriteFile(path, buf, 0644)
} }
func repoRoot() string { func repoRoot() string {

View File

@ -8029,4 +8029,3 @@ func (t opType) fieldToStringTagField() opType {
} }
return t return t
} }