This is an automated email from the ASF dual-hosted git repository.
mrutkowski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openwhisk-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new 9c1b901 Migrate to Go Modules (#143)
9c1b901 is described below
commit 9c1b9014e7850042a69fe6ddc3104b78a0d195bf
Author: Matt Rutkowski <[email protected]>
AuthorDate: Tue Feb 23 15:49:57 2021 -0600
Migrate to Go Modules (#143)
* Migrate to Go Modules
* Migrate to Go Modules
* Migrate to Go Modules
* Migrate to Go Modules
* Migrate to Go Modules
* update README for go mod
* Apply sugg. changes from Rodric
* Apply sugg. changes from Rodric
* Apply sugg. changes from Rodric
---
.travis.yml | 5 +--
README.md | 84 ++++++++++++++++++++++-----------------
go.mod | 17 ++++++++
go.sum | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++
vendor/vendor.json | 25 ------------
whisk/action.go | 3 +-
whisk/client.go | 1 +
whisk/client_test.go | 5 ++-
8 files changed, 184 insertions(+), 65 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index e9642a5..6eb4e5c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,7 +21,7 @@ matrix:
include:
- os: linux
sudo: required
- go: "1.13.14"
+ go: "1.15"
services: docker
dist: xenial
@@ -37,9 +37,8 @@ notifications:
before_install:
- cd $TRAVIS_BUILD_DIR
- - GO_FILES=$(find . -iname '*.go' -type f | grep -v /vendor/)
+ - GO_FILES=$(find . -iname '*.go' -type f)
- test -z "$(gofmt -s -l $(echo $GO_FILES))"
- #- pip install --upgrade pip setuptools
- pip install --user --upgrade pip setuptools
- ./tools/travis/setup.sh
diff --git a/README.md b/README.md
index 451992a..af9d261 100644
--- a/README.md
+++ b/README.md
@@ -21,55 +21,81 @@
[](http://www.apache.org/licenses/LICENSE-2.0)
[](https://travis-ci.com/apache/openwhisk-client-go)
-This project `openwhisk-client-go` is a Go client library to access Openwhisk
API.
+This project `openwhisk-client-go` is a Go client library to access the
Openwhisk API.
+---
+
+## Building the project
### Prerequisites
-You need to install the following package in order to run this Go client
library:
-- [Go](https://golang.org/doc/install)
-- [govendor](https://github.com/kardianos/govendor)
+The Openwhisk Go Client library requires you to [Download and install
GoLang](https://golang.org/dl/) onto your local machine.
+
+> **Note** Go version 1.15 or higher is recommended
Make sure you select the package that fits your local environment, and [set
the GOPATH environment
variable](https://github.com/golang/go/wiki/SettingGOPATH).
+### Download the source code from GitHub
+
+As the code is managed using GitHub, it is easiest to retrieve the code using
the `git clone` command.
+
+If you just want to build the code and do not intend to be a Contributor, you
can clone the latest code from the Apache repository:
+
+```sh
+git clone [email protected]:apache/openwhisk-client-go
+```
+
+You can also specify a release (tag), if you do not want the latest code, by
using the `--branch <tag>` flag. For example, you can clone the source code for
the tagged 1.1.0
[release](https://github.com/apache/openwhisk-client-go/releases)
+
+```sh
+git clone --branch 1.1.0 [email protected]:apache/openwhisk-client-go
+```
+
+You can also pull the code from a fork of the repository. If you intend to
become a Contributor to the project, read the section [Contributing to the
project](#contributing-to-the-project) below on how to setup a fork.
+
+### Building using `go build`
-### Installation
+Change into the cloned project directory and use the following command to
build all packages:
-After you download the source code either from the Github or the release page
of OpenWhisk, you should have a directory named
-_openwhisk-client-go_ to host all the source code. Please copy this root
directory _openwhisk-client-go_
-into the directory $GOPATH/src/github.com/apache.
+```sh
+$ go build -v ./...
+```
+
+or simply build just the whisk commands:
+
+```sh
+$ go build -v ./whisk
+```
+> **Note**: There is no `main` function in this project as the `./whish`
packages are treated together as a client library.
-### Test
+### Testing using `go test`
-Open a terminal, and run the following commands to run the unit tests:
+Open a terminal, change into the project directory and use the following
command to run the unit tests:
```
-$ cd $GOPATH/src/github.com/apache/openwhisk-client-go
-$ govendor sync
$ go test -v ./... -tags=unit
```
-You should see all the unit tests passed. If not, please [log an
issue](https://github.com/apache/openwhisk-client-go/issues) for us.
+You should see all the unit tests passed; if not, please [log an
issue](https://github.com/apache/openwhisk-client-go/issues) for us.
+---
-### Configuration
+## Configuration
This Go client library is used to access the OpenWhisk API, so please make
sure you have an OpenWhisk service running somewhere
available for you to run this library.
-We use a configuration file called _wskprop_ to specify all the parameters
necessary for this Go client library to access the OpenWhisk
-services. Make sure you create or edit the file _~/.wskprops_, and add the
mandatory parameters APIHOST, APIVERSION, NAMESPACE and AUTH.
+We use a configuration file called _wskprop_ to specify all the parameters
necessary for this Go client library to access the OpenWhisk services. Make
sure you create or edit the file _~/.wskprops_, and add the mandatory
parameters APIHOST, APIVERSION, NAMESPACE and AUTH.
-The parameter APIHOST is the OpenWhisk API hostname (for example,
openwhisk.ng.bluemix.net, 172.17.0.1, and so on).
-The parameter APIVERSION is the version of OpenWhisk API to be used to access
the OpenWhisk resources.
-The parameter NAMESPACE is the OpenWhisk namespace used to specify the
OpenWhisk resources about to be accessed.
-The parameter AUTH is the authentication key used to authenticate the incoming
requests to the OpenWhisk services.
+- The parameter `APIHOST` is the OpenWhisk API hostname (for example,
openwhisk.ng.bluemix.net, 172.17.0.1, and so on).
+- The parameter `APIVERSION` is the version of OpenWhisk API to be used to
access the OpenWhisk resources.
+- The parameter `NAMESPACE` is the OpenWhisk namespace used to specify the
OpenWhisk resources about to be accessed.
+- The parameter `AUTH` is the authentication key used to authenticate the
incoming requests to the OpenWhisk services.
For more information regarding the REST API of OpenWhisk, please refer to
[OpenWhisk REST
API](https://github.com/apache/openwhisk/blob/master/docs/rest_api.md).
-
-### Usage
+## Usage
```go
import "github.com/apache/openwhisk-client-go/whisk"
@@ -109,14 +135,10 @@ config := &whisk.Config{
client, err := whisk.Newclient(http.DefaultClient, config)
```
-
### Example
You need to have an OpenWhisk service accessible, to run the following example.
-Please be advised that all the Go files you are about to create should be
under the directory of $GOPATH or its subdirectories.
-For example, create the Go file named _openwhisk_client_go.go_ under a
directory called $GOPATH/src/example to try the following code.
-
```go
import (
"net/http"
@@ -152,15 +174,7 @@ func main() {
Then build it with the go tool:
```
-$ cd $GOPATH/src/example
$ go build
```
-The command above will build an executable named client in the directory
alongside your source code. Execute it to see the the result:
-
-```
-$ ./openwhisk_client_go
-```
-
-If the openWhisk service is available and your configuration is correct, you
should receive the status and the actions with
-the above example.
+If the openWhisk service is available and your configuration is correct, you
should receive the status and the actions with the above example.
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..cbbbd42
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,17 @@
+module github.com/apache/openwhisk-client-go
+
+go 1.14
+
+require (
+ github.com/BurntSushi/toml v0.3.1 // indirect
+ github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
+ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc //
indirect
+ github.com/fatih/color v1.10.0
+ github.com/google/go-querystring v1.0.0
+ github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519
+ github.com/nicksnyder/go-i18n v1.10.1
+ github.com/onsi/ginkgo v1.15.0 // indirect
+ github.com/onsi/gomega v1.10.5 // indirect
+ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 //
indirect
+ github.com/stretchr/testify v1.3.1-0.20190109162356-363ebb24d041
+)
diff --git a/go.sum b/go.sum
new file mode 100644
index 0000000..d1c04f6
--- /dev/null
+++ b/go.sum
@@ -0,0 +1,109 @@
+github.com/BurntSushi/toml v0.3.1
h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
+github.com/BurntSushi/toml v0.3.1/go.mod
h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/cloudfoundry/jibber_jabber v0.0.0-20151120183258-bcc4c8345a21
h1:tuijfIjZyjZaHq9xDUh0tNitwXshJpbLkqMOJv4H3do=
+github.com/cloudfoundry/jibber_jabber
v0.0.0-20151120183258-bcc4c8345a21/go.mod
h1:po7NpZ/QiTKzBKyrsEAxwnTamCoh8uDk/egRpQ7siIc=
+github.com/davecgh/go-spew v1.1.0/go.mod
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc
h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod
h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg=
+github.com/fatih/color v1.10.0/go.mod
h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
+github.com/fsnotify/fsnotify v1.4.7/go.mod
h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9
h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
+github.com/fsnotify/fsnotify v1.4.9/go.mod
h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
+github.com/golang/protobuf v1.2.0/go.mod
h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod
h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod
h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod
h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod
h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod
h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2
h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod
h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/google/go-cmp v0.3.0/go.mod
h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod
h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
+github.com/google/go-cmp v0.4.0/go.mod
h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-querystring v1.0.0
h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk=
+github.com/google/go-querystring v1.0.0/go.mod
h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
+github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519
h1:nqAlWFEdqI0ClbTDrhDvE/8LeQ4pftrqKUX9w5k0j3s=
+github.com/hokaccha/go-prettyjson v0.0.0-20210113012101-fb4e108d2519/go.mod
h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI=
+github.com/hpcloud/tail v1.0.0/go.mod
h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/mattn/go-colorable v0.1.8
h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8=
+github.com/mattn/go-colorable v0.1.8/go.mod
h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
+github.com/mattn/go-isatty v0.0.12
h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
+github.com/mattn/go-isatty v0.0.12/go.mod
h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
+github.com/nicksnyder/go-i18n v1.10.1
h1:isfg77E/aCD7+0lD/D00ebR2MV5vgeQ276WYyDaCRQc=
+github.com/nicksnyder/go-i18n v1.10.1/go.mod
h1:e4Di5xjP9oTVrC6y3C7C0HoSYXjSbhh/dU0eUV32nB4=
+github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
+github.com/nxadm/tail v1.4.4/go.mod
h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
+github.com/onsi/ginkgo v1.6.0/go.mod
h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.12.1/go.mod
h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
+github.com/onsi/ginkgo v1.15.0 h1:1V1NfVQR87RtWAgp1lv9JZJ5Jap+XFGKPi00andXGi4=
+github.com/onsi/ginkgo v1.15.0/go.mod
h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg=
+github.com/onsi/gomega v1.7.1/go.mod
h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1/go.mod
h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
+github.com/onsi/gomega v1.10.5 h1:7n6FEkpFmfCoo2t+YYqXH0evK+a9ICQz0xcAy9dYcaQ=
+github.com/onsi/gomega v1.10.5/go.mod
h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48=
+github.com/pelletier/go-toml v1.2.0
h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
+github.com/pelletier/go-toml v1.2.0/go.mod
h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pmezard/go-difflib v1.0.0/go.mod
h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod
h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/stretchr/objx v0.1.0/go.mod
h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/testify v1.3.1-0.20190109162356-363ebb24d041
h1:/8BeG8ppzttbNYq43j+0izFSyhj3rXBQIQQTju6WC/I=
+github.com/stretchr/testify v1.3.1-0.20190109162356-363ebb24d041/go.mod
h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/yuin/goldmark v1.2.1/go.mod
h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod
h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod
h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod
h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod
h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod
h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod
h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod
h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod
h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb
h1:eBmm0M9fYhWpKZLjQUUKka/LtIxf46G4fxeEz5KJr9U=
+golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod
h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod
h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod
h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod
h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
h1:/WDfKMnPU+m5M4xB+6x4kaepxRw6jWvR5iDRdvjHgy8=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210112080510-489259a85091
h1:DMyOG0U+gKfu8JZzg2UQe9MeaC1X+xQWlAKcRnjxjCw=
+golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod
h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod
h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod
h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod
h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
+golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod
h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod
h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod
h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod
h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod
h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod
h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0
h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod
h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod
h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod
h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod
h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/vendor/vendor.json b/vendor/vendor.json
deleted file mode 100644
index ab8ea88..0000000
--- a/vendor/vendor.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "comment": "",
- "ignore": "test",
- "package": [
- {
- "checksumSHA1": "CSPbwbyzqA6sfORicn4HFtIhF/c=",
- "path": "github.com/davecgh/go-spew/spew",
- "revision": "d8f796af33cc11cb798c1aaeb27a4ebc5099927d",
- "revisionTime": "2018-08-30T19:11:22Z"
- },
- {
- "checksumSHA1": "LuFv4/jlrmFNnDb/5SCSEPAM9vU=",
- "path": "github.com/pmezard/go-difflib/difflib",
- "revision": "5d4384ee4fb2527b0a1256a821ebfc92f91efefc",
- "revisionTime": "2018-12-26T10:54:42Z"
- },
- {
- "checksumSHA1": "qTNfPVU4Tz/JDMcSeL+k9HX2cV8=",
- "path": "github.com/stretchr/testify/assert",
- "revision": "363ebb24d041ccea8068222281c2e963e997b9dc",
- "revisionTime": "2019-01-09T08:30:14Z"
- }
- ],
- "rootPath": "github.com/apache/openwhisk-client-go"
-}
diff --git a/whisk/action.go b/whisk/action.go
index 5ee755f..5396568 100644
--- a/whisk/action.go
+++ b/whisk/action.go
@@ -20,10 +20,11 @@ package whisk
import (
"errors"
"fmt"
- "github.com/apache/openwhisk-client-go/wski18n"
"net/http"
"net/url"
"strings"
+
+ "github.com/apache/openwhisk-client-go/wski18n"
)
type ActionService struct {
diff --git a/whisk/client.go b/whisk/client.go
index 29c1a15..90337fc 100644
--- a/whisk/client.go
+++ b/whisk/client.go
@@ -674,6 +674,7 @@ func getApplicationErrorMessage(errResp interface{}) string
{
Debug(DbgInfo, "Application failure error json:
%+v\n", errObj)
// Concatenate all string field values into a
single error string
+ // Note: entry order of strings from map are
not preserved.
msgSeparator := ""
for _, val := range errObj {
valStr, valStrOk := val.(string)
diff --git a/whisk/client_test.go b/whisk/client_test.go
index b580c97..eea8cc4 100644
--- a/whisk/client_test.go
+++ b/whisk/client_test.go
@@ -181,8 +181,11 @@ func TestParseApplicationError(t *testing.T) {
"error": "Another error string",
}
+ // Note: since the client implementation uses a Go map,
+ // the entry order of strings concatenated is not preserved
errStr := getApplicationErrorMessage(appErr1)
- assert.Equal(t, "An error string; An error message", errStr)
+ assert.Contains(t, errStr, "An error string")
+ assert.Contains(t, errStr, "An error message")
errStr = getApplicationErrorMessage(appErr2)
assert.Equal(t, "Another error string", errStr)