From f031312214558ed79bd8988394ed22c9c7cd00cd Mon Sep 17 00:00:00 2001 From: pmahindrakar-oss <77798312+pmahindrakar-oss@users.noreply.github.com> Date: Thu, 20 May 2021 08:39:49 +0530 Subject: [PATCH] Using the new pflags which has --bind-default-var functionality (#70) * Using the new pflags which has --bind-default-var functionality Signed-off-by: Prafulla Mahindrakar * Using released version of stdlib Signed-off-by: Prafulla Mahindrakar --- cmd/create/projectconfig_flags.go | 10 +++++----- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/create/projectconfig_flags.go b/cmd/create/projectconfig_flags.go index db17e4882b..55a3eb8eed 100755 --- a/cmd/create/projectconfig_flags.go +++ b/cmd/create/projectconfig_flags.go @@ -50,10 +50,10 @@ func (ProjectConfig) mustMarshalJSON(v json.Marshaler) string { // flags is json-name.json-sub-name... etc. func (cfg ProjectConfig) GetPFlagSet(prefix string) *pflag.FlagSet { cmdFlags := pflag.NewFlagSet("ProjectConfig", pflag.ExitOnError) - cmdFlags.StringVar(&(projectConfig.ID), fmt.Sprintf("%v%v", prefix, "id"), *new(string), "id for the project specified as argument.") - cmdFlags.StringVar(&(projectConfig.Name), fmt.Sprintf("%v%v", prefix, "name"), *new(string), "name for the project specified as argument.") - cmdFlags.StringVar(&(projectConfig.File), fmt.Sprintf("%v%v", prefix, "file"), *new(string), "file for the project definition.") - cmdFlags.StringVar(&(projectConfig.Description), fmt.Sprintf("%v%v", prefix, "description"), *new(string), "description for the project specified as argument.") - cmdFlags.StringToStringVar(&(projectConfig.Labels), fmt.Sprintf("%v%v", prefix, "labels"), map[string]string{}, "labels for the project specified as argument.") + cmdFlags.StringVar(&projectConfig.ID, fmt.Sprintf("%v%v", prefix, "id"), projectConfig.ID, "id for the project specified as argument.") + cmdFlags.StringVar(&projectConfig.Name, fmt.Sprintf("%v%v", prefix, "name"), projectConfig.Name, "name for the project specified as argument.") + cmdFlags.StringVar(&projectConfig.File, fmt.Sprintf("%v%v", prefix, "file"), projectConfig.File, "file for the project definition.") + cmdFlags.StringVar(&projectConfig.Description, fmt.Sprintf("%v%v", prefix, "description"), projectConfig.Description, "description for the project specified as argument.") + cmdFlags.StringToStringVar(&projectConfig.Labels, fmt.Sprintf("%v%v", prefix, "labels"), projectConfig.Labels, "labels for the project specified as argument.") return cmdFlags } diff --git a/go.mod b/go.mod index cd987f766a..0f387bf4d7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.13 require ( github.com/dustin/go-humanize v1.0.0 // indirect github.com/flyteorg/flyteidl v0.18.40 - github.com/flyteorg/flytestdlib v0.3.15 + github.com/flyteorg/flytestdlib v0.3.21 github.com/ghodss/yaml v1.0.0 github.com/golang/protobuf v1.4.3 github.com/google/uuid v1.1.2 diff --git a/go.sum b/go.sum index a1ceb251bd..b8d3df4f31 100644 --- a/go.sum +++ b/go.sum @@ -176,8 +176,8 @@ github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4 github.com/flyteorg/flyteidl v0.18.40 h1:YuLBNpIotOFwyLSXSs0aj3B9N9vwPhzLRAQTWxYSI/w= github.com/flyteorg/flyteidl v0.18.40/go.mod h1:IJD02cc/95QMkGDBJNibsr5aWd6V7TlQiJ8Iz5mVZ28= github.com/flyteorg/flytestdlib v0.3.13/go.mod h1:Tz8JCECAbX6VWGwFT6cmEQ+RJpZ/6L9pswu3fzWs220= -github.com/flyteorg/flytestdlib v0.3.15 h1:vzsfqriENyavv6EBwsIm55di2wC+j0jkmjw30JGHAkM= -github.com/flyteorg/flytestdlib v0.3.15/go.mod h1:Tz8JCECAbX6VWGwFT6cmEQ+RJpZ/6L9pswu3fzWs220= +github.com/flyteorg/flytestdlib v0.3.21 h1:AF+y6wI64DNfoi4WtZU/v18Cfwksg32fijy7PZJ8d+I= +github.com/flyteorg/flytestdlib v0.3.21/go.mod h1:1XG0DwYTUm34Yrffm1Qy9Tdr/pWQypEqTq5dUxw3/cM= github.com/form3tech-oss/jwt-go v3.2.2+incompatible h1:TcekIExNqud5crz4xD2pavyTgWiPvpYe4Xau31I0PRk= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db/go.mod h1:7dvUGVsVBjqR7JHJk0brhHOZYGmfBYOrK0ZhYMEtBr4=