File tree Expand file tree Collapse file tree 3 files changed +12
-1
lines changed
Expand file tree Collapse file tree 3 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,8 @@ func NewdomainCmd() *cobra.Command {
4141 return err
4242 }
4343 urls := strings .Split (p .Callbackurl , ";" )
44- if ! strings .Contains (p .Callbackurl , opts .Domain ) {
44+ _ , found := cmdutil .Find (urls , opts .Domain )
45+ if ! found {
4546 return & cmdutil.FlagError {Err : errors .New ("Entered Domain not found" )}
4647 }
4748 if len (urls ) == 1 {
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ func configure() error {
3333 if err != nil {
3434 return err
3535 }
36+ fmt .Println ("App Name:" , resp .Appname )
3637 fmt .Println ("API Key:" , resp .Key )
3738 fmt .Println ("API Secret:" , resp .Secret )
3839 return nil
Original file line number Diff line number Diff line change @@ -108,3 +108,12 @@ func UAString() string {
108108 }
109109 return ""
110110}
111+
112+ func Find (slice []string , val string ) (int , bool ) {
113+ for i , item := range slice {
114+ if item == val {
115+ return i , true
116+ }
117+ }
118+ return - 1 , false
119+ }
You can’t perform that action at this time.
0 commit comments