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