1
0
mirror of https://github.com/golang/go synced 2024-11-18 15:44:41 -07:00

imports: add go:generate directive for generating zstdlib.go

Change-Id: I8c54e01799f690819cda746ad5fb7c4d87e769c4
Reviewed-on: https://go-review.googlesource.com/22541
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Konstantin Shaposhnikov 2016-04-28 10:55:11 +08:00 committed by Brad Fitzpatrick
parent 686d0ad5b8
commit d4437bf597
2 changed files with 7 additions and 1 deletions

View File

@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:generate go run mkstdlib.go
// Package imports implements a Go pretty-printer (like package "go/format")
// that also adds or removes import statements as necessary.
package imports // import "golang.org/x/tools/imports"

View File

@ -11,6 +11,7 @@ import (
"fmt"
"go/format"
"io"
"io/ioutil"
"log"
"os"
"path"
@ -90,5 +91,8 @@ func main() {
if err != nil {
log.Fatal(err)
}
os.Stdout.Write(fmtbuf)
err = ioutil.WriteFile("zstdlib.go", fmtbuf, 0666)
if err != nil {
log.Fatal(err)
}
}