Browse Source
Merge pull request #48 from toranger/master
fix the example of get, reorder the import package
tags/v0.7.8
toranger
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
7 deletions
-
.travis.yml
-
example/object/get.go
|
|
@ -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) |
|
|
|
} |
|
|
|
xxxxxxxxxx