You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: volume.go
    path of file: ./repos/erda/apistructs
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache L
    
func VolumeTypeFromString(s string) (VolumeType, error) {
	switch s {
	case "local":
		fallthrough
	case LocalVolumeStr:
		return LocalVolume, nil
	case "nas":
		fallthrough
	case NasVolumeStr:
		return NasVolume, nil
	}
	return LocalVolume, fmt.Errorf("illegal volume type: %s", s)
}