This commit is contained in:
@ -1,6 +1,10 @@
|
||||
package utils
|
||||
|
||||
import "math/rand"
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
|
||||
@ -15,3 +19,11 @@ func RandStringBytes(n int) string {
|
||||
func BoolPointer(b bool) *bool {
|
||||
return &b
|
||||
}
|
||||
|
||||
func CheckError(err error, caller string) {
|
||||
if err != nil {
|
||||
log.WithFields(log.Fields{
|
||||
"Caller": caller,
|
||||
}).Warnf("Error from hetzner API: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user