go4.org@v0.0.0-20230225012048-214862532bf5/legal/legal.go (about)

     1  /*
     2  Copyright 2014 The Go4 Authors
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8       http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  // Package legal provides in-process storage for compiled-in licenses.
    18  package legal // import "go4.org/legal"
    19  
    20  var licenses []string
    21  
    22  // RegisterLicense stores the license text.
    23  // It doesn't check whether the text was already present.
    24  func RegisterLicense(text string) {
    25  	licenses = append(licenses, text)
    26  	return
    27  }
    28  
    29  // Licenses returns a slice of the licenses.
    30  func Licenses() []string {
    31  	return licenses
    32  }