fix servicemesh options nil bug

This commit is contained in:
Jeff
2019-09-25 01:16:13 +08:00
committed by zryfish
parent 284c0d6425
commit d0dc66cf28
16 changed files with 48 additions and 105 deletions

View File

@@ -5,8 +5,8 @@ import (
)
type SonarQubeOptions struct {
Host string `json:",omitempty" yaml:",omitempty" description:"SonarQube service host address"`
Token string `json:",omitempty" yaml:",omitempty" description:"SonarQube service token"`
Host string `json:",omitempty" yaml:"host" description:"SonarQube service host address"`
Token string `json:",omitempty" yaml:"token" description:"SonarQube service token"`
}
func NewSonarQubeOptions() *SonarQubeOptions {
@@ -27,11 +27,6 @@ func (s *SonarQubeOptions) Validate() []error {
}
func (s *SonarQubeOptions) ApplyTo(options *SonarQubeOptions) {
if options == nil {
options = s
return
}
if s.Host != "" {
options.Host = s.Host
options.Token = s.Token