Skip to content

Commit 346b7d7

Browse files
authoredSep 20, 2022
chore: Add license to hack gen (#2536)
1 parent 11ea80b commit 346b7d7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed
 

‎hack/code/prices_gen.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"flag"
2121
"fmt"
2222
"go/format"
23-
"io/ioutil"
2423
"log"
2524
"os"
2625
"runtime"
@@ -31,6 +30,8 @@ import (
3130

3231
"github.com/aws/aws-sdk-go/aws/session"
3332
ec22 "github.com/aws/aws-sdk-go/service/ec2"
33+
"github.com/samber/lo"
34+
3435
"github.com/aws/karpenter/pkg/cloudprovider/aws"
3536
)
3637

@@ -65,6 +66,8 @@ func main() {
6566

6667
src := &bytes.Buffer{}
6768
fmt.Fprintln(src, "//go:build !ignore_autogenerated")
69+
license := lo.Must(os.ReadFile("hack/boilerplate.go.txt"))
70+
fmt.Fprintln(src, string(license))
6871
fmt.Fprintln(src, "package aws")
6972
fmt.Fprintln(src, `import "time"`)
7073
now := time.Now().UTC().Format(time.RFC3339)
@@ -81,7 +84,7 @@ func main() {
8184
log.Fatalf("formatting generated source, %s", err)
8285
}
8386

84-
if err := ioutil.WriteFile(flag.Arg(0), formatted, 0644); err != nil {
87+
if err := os.WriteFile(flag.Arg(0), formatted, 0644); err != nil {
8588
log.Fatalf("writing output, %s", err)
8689
}
8790
runtime.GC()

0 commit comments

Comments
 (0)
Please sign in to comment.