func GenerateChecksum(v interface{}) string {
	hash, err := hashstructure.Hash(v, nil)
	if err != nil {
		logrus.Fatalf("Failed to generate hash: %v", err)
	}
	return fmt.Sprintf("%d", hash)
}
GenerateChecksum generates hash value of given interface
package kci
import (
	"fmt"
	"time"
	"github.com/mitchellh/hashstructure"
	"github.com/sirupsen/logrus"
)
func appendIfMissing(slice []string, s string) []string {
	if len(slice) == 0 {
		return append(slice, s)
	}
	for _, ele := range slice {
		if ele == s {
			return slice
		}
	}
	return append(slice, s)
}
func removeItem(slice []string, s string) []string {
	newslice := []string{}
	for _, ele := range slice {
		if ele != s {
			newslice = append(newslice, ele)
		}
	}
	return newslice
}
func StringNotEmpty(values ...string) string {
	for _, value := range values {
		if value != "" {
			return value
		}
	}
	return ""
}
type stop struct {
	error
}
func Retry(attempts int, intervals time.Duration, fn func() error) error {
	if err := fn(); err != nil {
		if s, ok := err.(stop); ok {
			return s.error
		}
		if attempts--; attempts > 0 {
			time.Sleep(intervals)
			return Retry(attempts, intervals, fn)
		}
		return err
	}
	return nil
}