func RemoveDuplicateElement(addrs []string) []string {
	result := make([]string, 0, len(addrs))
	temp := map[string]struct{}{}
	for _, item := range addrs {
		if _, ok := temp[item]; !ok {
			temp[item] = struct{}{}
			result = append(result, item)
		}
	}
	return result
}
/* ------------------- slice deduplication ---------------------
package utils
import (
	"encoding/binary"
	"encoding/hex"
	"errors"
	"fmt"
	"log"
	"math/rand"
	"net"
	"os"
	"reflect"
	"runtime"
	"time"
	"github.com/Dliv3/Venom/crypto"
)
func UUIDToArray32(hashID string) [32]byte {
	currnetHashIDSlice, _ := hex.DecodeString(hashID)
	return SliceTo32ByteArray(currnetHashIDSlice)
}
func Array32ToUUID(bytes [32]byte) string {
	return fmt.Sprintf("%x", bytes)
}
func NewUUID() string {
	return crypto.Sha256(time.Now().Format(time.ANSIC) + GetRandomString(5))
}
func GetRandomString(length int) string {
	str := "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
	bytes := []byte(str)
	result := []byte{}
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	for i := 0; i < length; i++ {
		result = append(result, bytes[r.Intn(len(bytes))])
	}
	return string(result)
}
func Uint32ToBytes(i uint32) []byte {
	var buf = make([]byte, 4)
	binary.BigEndian.PutUint32(buf, uint32(i))
	return buf
}
func BytesToUint32(buf []byte) uint32 {
	return uint32(binary.BigEndian.Uint32(buf))
}
func Uint16ToBytes(i uint16) []byte {
	var buf = make([]byte, 2)
	binary.BigEndian.PutUint16(buf, uint16(i))
	return buf
}
func BytesToUint16(buf []byte) uint16 {
	return uint16(binary.BigEndian.Uint16(buf))
}
func Uint64ToBytes(i uint64) []byte {
	var buf = make([]byte, 8)
	binary.BigEndian.PutUint64(buf, uint64(i))
	return buf
}
func BytesToUint64(buf []byte) uint64 {
	return uint64(binary.BigEndian.Uint64(buf))
}
func SliceTo32ByteArray(buf []byte) [32]byte {
	var result [32]byte
	for i := 0; i < 32; i++ {
		result[i] = buf[i]
	}
	return result
}
func IpToUint32(ip net.IP) uint32 {
	if len(ip) == 16 {
		return binary.BigEndian.Uint32(ip[12:16])
	}
	return binary.BigEndian.Uint32(ip)
}
func Uint32ToIp(nn uint32) net.IP {
	ip := make(net.IP, 4)
	binary.BigEndian.PutUint32(ip, nn)
	return ip
}
func GetSystemType() (osType uint32) {
	var os = runtime.GOOS
	switch os {
	case "darwin":
		osType = 0x00
	case "windows":
		osType = 0x01
	case "linux":
		osType = 0x02
	default:
		osType = 0xff
	}
	return
}
func FileExists(filename string) bool {
	var exist = true
	if _, err := os.Stat(filename); os.IsNotExist(err) {
		exist = false
	}
	return exist
}
func IsDir(path string) bool {
	s, err := os.Stat(path)
	if err != nil {
		return false
	}
	return s.IsDir()
}
func GetFileSize(path string) int64 {
	fileInfo, err := os.Stat(path)
	if err != nil {
		panic(err)
	}
	fileSize := fileInfo.Size()  
	return fileSize
}
func GetFileSizeDescription(fileSize uint64) string {
	fileSizeFloat := float64(fileSize)
	const K = 1024 * 1.0
	const M = K * 1024
	const G = M * 1024
	if fileSizeFloat >= G {
		return fmt.Sprintf("%0.2fG", fileSizeFloat/G)
	}
	if fileSizeFloat >= M {
		return fmt.Sprintf("%0.2fM", fileSizeFloat/M)
	}
	return fmt.Sprintf("%0.2fK", fileSizeFloat/K)
}
func PacketSize(packet interface{}) (uint64, error) {
	var size uint64
	size = 0
	t := reflect.TypeOf(packet)
	v := reflect.ValueOf(packet)
	if k := t.Kind(); k != reflect.Struct {
		return 0, errors.New("Param is Not Struct")
	}
	count := t.NumField()
	for i := 0; i < count; i++ {
		val := v.Field(i).Interface()
		switch value := val.(type) {
		case uint16:
			size += 2
		case uint32:
			size += 4
		case uint64:
			size += 8
		case string:
			size += uint64(len(value))
		case []byte:
			size += uint64(len(value))
		case [2]byte:
			size += uint64(len(value))
		case [4]byte:
			size += uint64(len(value))
		case [32]byte:
			size += uint64(len(value))
		default:
			log.Fatalln("[-]PacketSize error: type unsupport")
			return 0, errors.New("Type unsupport")
		}
	}
	return size, nil
}