Skip to content

Commit

Permalink
Update to metamodel 0.0.25
Browse files Browse the repository at this point in the history
The more relevant changes in the new version of the metamodel are the
following:

- Run the `gofmt` command only once for all generated files instead of running
  it once per each generated file.
- Avoid generating code with constructs that would then be simplified by the
  `-s` flag of the `gofmt` command.

Signed-off-by: Juan Hernandez <jhernand@redhat.com>
  • Loading branch information
jhernand committed Feb 20, 2020
1 parent 6e0fabf commit 95c0c79
Show file tree
Hide file tree
Showing 30 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ model_version:=v0.0.41
model_url:=https://github.com/openshift-online/ocm-api-model.git

# Details of the metamodel to use:
metamodel_version:=v0.0.24
metamodel_version:=v0.0.25
metamodel_url:=https://github.com/openshift-online/ocm-api-metamodel.git

.PHONY: examples
Expand Down
2 changes: 1 addition & 1 deletion accountsmgmt/v1/access_token_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func writeAccessToken(object *AccessToken, stream *jsoniter.Stream) {
stream.WriteObjectStart()
keys := make([]string, len(object.auths))
i := 0
for key, _ := range object.auths {
for key := range object.auths {
keys[i] = key
i++
}
Expand Down
2 changes: 1 addition & 1 deletion authentication/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import (
"github.com/dgrijalva/jwt-go"
"github.com/ghodss/yaml"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
"github.com/openshift-online/ocm-sdk-go/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion authentication/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

"github.com/dgrijalva/jwt-go"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func TestAuthentication(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion clustersmgmt/v1/cluster_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func writeCluster(object *Cluster, stream *jsoniter.Stream) {
stream.WriteObjectStart()
keys := make([]string, len(object.properties))
i := 0
for key, _ := range object.properties {
for key := range object.properties {
keys[i] = key
i++
}
Expand Down
2 changes: 1 addition & 1 deletion clustersmgmt/v1/open_id_identity_provider_type_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func writeOpenIDIdentityProvider(object *OpenIDIdentityProvider, stream *jsonite
stream.WriteObjectStart()
keys := make([]string, len(object.extraAuthorizeParameters))
i := 0
for key, _ := range object.extraAuthorizeParameters {
for key := range object.extraAuthorizeParameters {
keys[i] = key
i++
}
Expand Down
3 changes: 2 additions & 1 deletion connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ limitations under the License.
package sdk

import (
"github.com/onsi/gomega/gbytes"
"net/http"
"time"

"github.com/onsi/gomega/gbytes"

. "github.com/onsi/ginkgo" // nolint
. "github.com/onsi/gomega" // nolint
)
Expand Down
2 changes: 1 addition & 1 deletion examples/client_credentials_grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/create_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/delete_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/delete_subscription.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/existing_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"io/ioutil"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/export_control_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
azv1 "github.com/openshift-online/ocm-sdk-go/authorizations/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/get_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/get_cluster_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/get_cluster_logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"log"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/get_cluster_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/get_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/list_cloud_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/list_cluster_creators.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
"text/tabwriter"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/list_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/list_quota_summary.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
"text/tabwriter"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
amv1 "github.com/openshift-online/ocm-sdk-go/accountsmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/list_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/prometheus_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/prometheus/client_golang/prometheus/promhttp"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/resource_review.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
azv1 "github.com/openshift-online/ocm-sdk-go/authorizations/v1"
)

Expand Down
4 changes: 2 additions & 2 deletions examples/run_cluster_operator_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func main() {
Expand Down Expand Up @@ -66,7 +66,7 @@ func main() {
}

// Print the results:
for _, operator := range response.Body().Operators(){
for _, operator := range response.Body().Operators() {
fmt.Printf("Name: %v\n", operator.Name())
fmt.Printf("Reason: %s\n", operator.Reason())
fmt.Printf("Time: %f\n", operator.Time())
Expand Down
2 changes: 1 addition & 1 deletion examples/run_metric_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/sync_addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (

"github.com/ghodss/yaml"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down
2 changes: 1 addition & 1 deletion examples/transport_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"net/http"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
)

type LoggingTransport struct {
Expand Down
2 changes: 1 addition & 1 deletion examples/update_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"fmt"
"os"

"github.com/openshift-online/ocm-sdk-go"
sdk "github.com/openshift-online/ocm-sdk-go"
cmv1 "github.com/openshift-online/ocm-sdk-go/clustersmgmt/v1"
)

Expand Down

0 comments on commit 95c0c79

Please sign in to comment.