-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Expand file tree
/
Copy pathmain.go
More file actions
35 lines (29 loc) · 961 Bytes
/
main.go
File metadata and controls
35 lines (29 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Copyright 2016 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
package main
import (
"errors"
"os"
"github.com/open-policy-agent/opa/cmd"
)
func main() {
var exit int
defer func() {
if exit != 0 {
os.Exit(exit)
}
}() // orderly shutdown, run all defer routines
if err := cmd.RootCommand.Execute(); err != nil {
var e *cmd.ExitError
if errors.As(err, &e) {
exit = e.Exit
} else {
exit = 1
}
}
}
//go:generate build/gen-run-go.sh github.com/mna/pigeon@v1.3.0 -o v1/topdown/durationparser/duration_parser.go v1/topdown/durationparser/duration.peg
//go:generate build/gen-run-go.sh internal/cmd/genopacapabilities/main.go capabilities.json
//go:generate build/gen-run-go.sh internal/cmd/genbuiltinmetadata/main.go builtin_metadata.json
//go:generate build/gen-run-go.sh internal/cmd/genversionindex/main.go v1/ast/version_index.json