-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updates the copyrights for Broadcom. - Updates `main.go` to add the copyright after the SDK is generated. Signed-off-by: Ryan Johnson <[email protected]>
- Loading branch information
1 parent
ed2eff1
commit 249cc77
Showing
7 changed files
with
61 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,9 @@ representative at an online or offline event. | |
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at [email protected]. | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
reported to the community leaders responsible for enforcement at | ||
[email protected]. All complaints will be reviewed and investigated | ||
promptly and fairly. | ||
|
||
All community leaders are obligated to respect the privacy and security of the | ||
reporter of any incident. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Copyright 2023 VMware, Inc. | ||
© Broadcom. All Rights Reserved. | ||
The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. | ||
|
||
This product is licensed to you under the BSD 2 clause (the "License"). You may not use this product except in compliance with the License. | ||
|
||
This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. | ||
This product may include a number of subcomponents with separate copyright notices and license terms. Your use of these subcomponents is subject to the terms and conditions of the subcomponent's license, as noted in the LICENSE file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
Copyright 2023 VMware, Inc. | ||
SPDX-License-Identifier: BSD-2-Clause | ||
// © Broadcom. All Rights Reserved. | ||
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,46 @@ | ||
// © Broadcom. All Rights Reserved. | ||
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
|
||
//go:generate go run github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen -config cfg.yaml swagger.json | ||
//go:generate go run main.go -add-header | ||
|
||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
) | ||
|
||
func main() { | ||
addHeader := flag.Bool("add-header", false, "Add header to generated SDK.") | ||
flag.Parse() | ||
|
||
if *addHeader { | ||
const headerFile = "copyright.txt" | ||
const generatedFile = "./vcf/vcf.gen.go" | ||
|
||
header, err := os.ReadFile(headerFile) | ||
if err != nil { | ||
fmt.Println(fmt.Errorf("error reading header file: %w", err)) | ||
os.Exit(1) | ||
} | ||
|
||
content, err := os.ReadFile(generatedFile) | ||
if err != nil { | ||
fmt.Println(fmt.Errorf("error reading generated file: %w", err)) | ||
os.Exit(1) | ||
} | ||
|
||
newContent := string(header) + string(content) | ||
|
||
err = os.WriteFile(generatedFile, []byte(newContent), 0644) | ||
if err != nil { | ||
fmt.Println(fmt.Errorf("error writing to generated file: %w", err)) | ||
os.Exit(1) | ||
} | ||
|
||
fmt.Println("Header added to", generatedFile) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.