@ -95,7 +95,20 @@ func main() {
}
}
contents := new ( bytes . Buffer )
contents := new ( bytes . Buffer )
fmt . Fprintf ( contents , header , * flagTypes , pkg . Name )
var flagArgs [ ] string
if * flagTypes != "" {
flagArgs = append ( flagArgs , "-type=" + * flagTypes )
}
if * flagOutput != "" {
flagArgs = append ( flagArgs , "-output=" + * flagOutput )
}
if * flagBuildTags != "" {
flagArgs = append ( flagArgs , "-tags=" + * flagBuildTags )
}
if * flagCloneFunc {
flagArgs = append ( flagArgs , "-clonefunc" )
}
fmt . Fprintf ( contents , header , strings . Join ( flagArgs , " " ) , pkg . Name )
fmt . Fprintf ( contents , "import (\n" )
fmt . Fprintf ( contents , "import (\n" )
for s := range imports {
for s := range imports {
fmt . Fprintf ( contents , "\t%q\n" , s )
fmt . Fprintf ( contents , "\t%q\n" , s )
@ -117,8 +130,8 @@ const header = `// Copyright (c) 2020 Tailscale Inc & AUTHORS All rights reserve
// Use of this source code is governed by a BSD-style
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// license that can be found in the LICENSE file.
// Code generated by t he following command ; DO NOT EDIT.
// Code generated by t ailscale.com/cmd/cloner ; DO NOT EDIT.
// tailscale.com/cmd/cloner -type %s
// go:generate go run tailscale.com/cmd/cloner %s
package % s
package % s