clean up pointerisms, fix building real client
google github library returns *Foo in singular case and []Foo if there are many results. seems like the best approach is to pass them around by-value, since *Foo seems to only be so that they can return 'nil' instead of a zero-value.
This commit is contained in:
@@ -95,8 +95,7 @@ func (c *InCommand) Run(destDir string, request InRequest) (InResponse, error) {
|
||||
|
||||
fmt.Fprintf(c.writer, "downloading asset: %s\n", *asset.Name)
|
||||
|
||||
assetToDownload := asset
|
||||
err := c.downloadFile(&assetToDownload, path)
|
||||
err := c.downloadFile(asset, path)
|
||||
if err != nil {
|
||||
return InResponse{}, err
|
||||
}
|
||||
@@ -110,7 +109,7 @@ func (c *InCommand) Run(destDir string, request InRequest) (InResponse, error) {
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *InCommand) downloadFile(asset *github.ReleaseAsset, destPath string) error {
|
||||
func (c *InCommand) downloadFile(asset github.ReleaseAsset, destPath string) error {
|
||||
out, err := os.Create(destPath)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user