INNER CODE UNIT · Go

getLicense

kptdev/kpt · mdtogo/main.go:110

func getLicense() string {
	var license string

	switch licenseFile {
	case "":
		license = `// Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0`
	case "none":
		// no license -- maybe added by another tool
	default:
		b, err := os.ReadFile(licenseFile)
		if err != nil {
			fmt.Fprintf(os.Stderr, "%v\n", err)
			os.Exit(1)
		}
		license = string(b)
	}
	return license

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…