Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Commit

Permalink
Remove build tag (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
Porges authored Nov 24, 2020
1 parent a540491 commit 1c684b6
Show file tree
Hide file tree
Showing 39 changed files with 6 additions and 60 deletions.
24 changes: 5 additions & 19 deletions hack/generator/pkg/astmodel/file_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,11 @@ func (file *FileDefinition) AsAst() *ast.File {
})
}

var comments []string
comments = append(comments, CodeGenerationComments...)
comments = append(comments,
"Copyright (c) Microsoft Corporation.",
"Licensed under the MIT license.")

header := createComments(comments...)
var header []string
header = append(header, CodeGenerationComments...)
header = append(header,
"// Copyright (c) Microsoft Corporation.",
"// Licensed under the MIT license.")

packageName := file.packageReference.PackageName()

Expand All @@ -275,18 +273,6 @@ func (file *FileDefinition) AsAst() *ast.File {
return result
}

// createComments converts a series of strings into a series of comments,
// returning both the comments and their text length
func createComments(lines ...string) ast.Decorations {
var result ast.Decorations
for _, l := range lines {
line := "// " + l + "\n"
result = append(result, line)
}

return result
}

// SaveToWriter writes the file to the specifier io.Writer
func (file FileDefinition) SaveToWriter(filename string, dst io.Writer) error {
original := file.AsAst()
Expand Down
5 changes: 1 addition & 4 deletions hack/generator/pkg/astmodel/generation_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ package astmodel

var (
CodeGenerationComments []string = []string{
// Compiler-readable comment, must be first in file:
"+build !ignore_autogenerated",

// Note that this format is actually an official specification in go: https://github.com/golang/go/issues/13560
"Code generated by k8s-infra. DO NOT EDIT.", // TODO: Update this when the generated is moved/renamed
"// Code generated by k8s-infra. DO NOT EDIT.", // TODO: Update this when the generated is moved/renamed
}
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// +build !ignore_autogenerated
// Code generated by k8s-infra. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
Expand Down

0 comments on commit 1c684b6

Please sign in to comment.