草庐IT

MyFilesService

全部标签

go - 如何使用 Go 接口(interface)来测试 Google API Golang 库?

我正在尝试使用接口(interface)来测试使用google'sdriveapilib的代码.typeMyFilestruct{DownloadUrlstring`json:"downloadUrl,omitempty"`}typeMyFilesGetCallinterface{Do()(*MyFile,error)//Do()(*drive.File,error)//thisDOESwork}typeMyFilesServiceinterface{Get(string)*MyFilesGetCall//Get(string)*drive.FilesGetCall//thisDOES