fix the example of get, reorder the import package
This commit is contained in:
@@ -9,13 +9,15 @@ go:
|
||||
- master
|
||||
sudo: false
|
||||
before_install:
|
||||
- go get github.com/mattn/goveralls
|
||||
- go get github.com/stretchr/testify
|
||||
- go get -u github.com/mattn/goveralls
|
||||
- go get -u github.com/stretchr/testify
|
||||
install:
|
||||
- go get
|
||||
- go build
|
||||
- go build github.com/mattn/goveralls
|
||||
script:
|
||||
- if [[ ! -n "$COS_SECRETID" ]]; then exit 0
|
||||
; fi
|
||||
- make test
|
||||
- make ci-test
|
||||
- go test -coverprofile=cover.out github.com/toranger/cos-go-sdk-v5
|
||||
|
||||
@@ -3,13 +3,11 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
|
||||
"github.com/tencentyun/cos-go-sdk-v5"
|
||||
"github.com/tencentyun/cos-go-sdk-v5/debug"
|
||||
@@ -55,7 +53,7 @@ func main() {
|
||||
resp.Body.Close()
|
||||
|
||||
// Case3 Download object to local file path
|
||||
err = c.Object.GetToFile(context.Background(), name, "hello_1.txt", nil)
|
||||
_, err = c.Object.GetToFile(context.Background(), name, "hello_1.txt", nil)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user