func ExtractArchive(src string) (string, error) {
	dest, err := ioutil.TempDir("", "apim")
	if err != nil {
		_ = os.RemoveAll(dest)
		return "", err
	}
	files, err := Unzip(src, dest)
	if err != nil {
		return "", err
	}
	if len(files) == 0 {
		return "", fmt.Errorf("invalid API archive")
	}
	r := strings.TrimPrefix(files[0], src)
	return filepath.Join(dest, strings.Split(filepath.Clean(r), string(os.PathSeparator))[0]), nil
}
// ExtractArchive extracts the API and give the path.
// In API Manager archive there is a directory in the root which contains the API
// this function returns it appended to the destination path
ExtractArchive extracts the API and give the path.
In API Manager archive there is a directory in the root which contains the API
this function returns it appended to the destination path
// ExtractArchive extracts the API and give the path . // In API Manager archive there is a directory in the root which contains the API // this function returns it appended to the destination path
func ExtractArchive(src string) (string, error) {
	dest, err := ioutil.TempDir("", "apim")
	if err != nil {
		_ = os.RemoveAll(dest)
		return "", err
	}
	files, err := Unzip(src, dest)
	if err != nil {
		return "", err
	}
	if len(files) == 0 {
		return "", fmt.Errorf("invalid API archive")
	}
	r := strings.TrimPrefix(files[0], src)
	return filepath.Join(dest, strings.Split(filepath.Clean(r), string(os.PathSeparator))[0]), nil
}
func ExtractArchive ( src string ) ( string , error ) { dest , err := ioutil . TempDir ( " " , " " ) if err != nil { _ = os . RemoveAll ( dest ) return " " , err } files , err := Unzip ( src , dest ) if err != nil { return " " , err } if len ( files ) == 0 { return " " , fmt . Errorf ( " " ) } r := strings . TrimPrefix ( files [ 0 ] , src ) return filepath . Join ( dest , strings . Split ( filepath . Clean ( r ) , string ( os . PathSeparator ) ) [ 0 ] ) , nil }
ExtractArchive extracts the API and give the path.
ExtractArchive extracts the API and give the path .