packageclientimport("bytes""encoding/json""io/ioutil""net/http""github.com/docker/docker/api/types""golang.org/x/net/context")// VolumeInspect returns the information about a specific volume in the docker host.func(cli*Client)VolumeInspect(ctxcontext.Context,volumeIDstring)(types.Volume,error){volume,_,err:=cli.VolumeInspectWithRaw(ctx,volumeID)returnvolume,err}// VolumeInspectWithRaw returns the information about a specific volume in the docker host and its raw representationfunc(cli*Client)VolumeInspectWithRaw(ctxcontext.Context,volumeIDstring)(types.Volume,[]byte,error){varvolumetypes.Volumeresp,err:=cli.get(ctx,"/volumes/"+volumeID,nil,nil)iferr!=nil{ifresp.statusCode==http.StatusNotFound{returnvolume,nil,volumeNotFoundError{volumeID}}returnvolume,nil,err}deferensureReaderClosed(resp)body,err:=ioutil.ReadAll(resp.body)iferr!=nil{returnvolume,nil,err}rdr:=bytes.NewReader(body)err=json.NewDecoder(rdr).Decode(&volume)returnvolume,body,err}