Debian Codegraph @

examples/set-gen/main.go

raw
1 /*
2 Copyright 2015 The Kubernetes 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 // set-gen is an example usage of go2idl.
18 //
19 // Structs in the input directories with the below line in their comments will
20 // have sets generated for them.
21 // // +genset
22 //
23 // Any builtin type referenced anywhere in the input directories will have a
24 // set generated for it.
25 package main
26
27 import (
28 "os"
29
30 "k8s.io/gengo/args"
31 "k8s.io/gengo/examples/set-gen/generators"
32
33 "k8s.io/klog/v2"
34 )
35
36 func main() {
37 klog.InitFlags(nil)
38 arguments := args.Default()
39 if err := arguments.Execute(
40 generators.NameSystems(),
41 generators.DefaultNameSystem(),
42 generators.Packages,
43 ); err != nil {
44 klog.Errorf("Error: %v", err)
45 os.Exit(1)
46 }
47 klog.V(2).Info("Completed successfully.")
48 }