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 (
"bytes"
"fmt"
"go/format"
"io/ioutil"
"path/filepath"
"runtime"
@ -380,7 +381,11 @@ func (t opType) fieldToStringTagField() opType {
return err
}
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 {

File diff suppressed because it is too large Load Diff