feat(api): adding api server code
templater can be used as a commmand line tool or as an api server.
This commit is contained in:
17
pkg/utils/main.go
Normal file
17
pkg/utils/main.go
Normal file
@ -0,0 +1,17 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/hcl/v2"
|
||||
)
|
||||
|
||||
func CheckErr(e error) {
|
||||
if e != nil {
|
||||
panic(e)
|
||||
}
|
||||
}
|
||||
|
||||
func CheckDiags(diag hcl.Diagnostics) {
|
||||
if diag.HasErrors() {
|
||||
panic(diag.Error())
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user