Skip to content

change script - #495

Merged
wonderflow merged 1 commit into
qiniu:masterfrom
redHJ:changeScript
May 22, 2018
Merged

wonderflow merged 1 commit into
qiniu:masterfrom
redHJ:changeScript

Conversation

@redHJ

@redHJ redHJ commented May 22, 2018

Copy link
Copy Markdown
Collaborator

Comment thread transforms/mutate/script.go Outdated
New string `json:"new"`
Interprepter string `json:"interprepter"`
ScriptPath string `json:"scriptpath"`
ScriptPath string `json:"script_path"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不允许的

Comment thread transforms/mutate/script.go Outdated
keysArr := strings.Split(g.Key, ",")
keysMap := make(map[string][]string, 0)
for _, key := range keysArr {
key = strings.Trim(key, " ")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strings.TimSpace

@redHJ
redHJ force-pushed the changeScript branch 2 times, most recently from edbaf7d to c9bb226 Compare May 22, 2018 08:58
Comment thread transforms/mutate/script.go Outdated
var gerr error
if scriptPath == "" {
params := make([]string, 0)
params = append(params, scriptPath)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params := []string{scriptPath}

Comment thread transforms/mutate/script.go Outdated
err = fmt.Errorf("transform key %v data type is not string", g.Key)
continue
} else {
params = append(params, val.(string))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里上面的 _可以写值,写成:

if val_s, ok := val.(string); !ok {
}else{
params = append(params, val_s)
}

Required: true,
DefaultNoUse: false,
Description: "脚本执行解释器",
Description: "脚本执行解释器(interprepter)",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面的New这个key要必填了,如果不能复用,就写个新的

Comment thread transforms/registry.go Outdated
ChooseOnly: false,
Default: "",
Required: false,
Required: true,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不能直接改这里,老样子,兼容性!

@redHJ

redHJ commented May 22, 2018

Copy link
Copy Markdown
Collaborator Author

改好了

@redHJ
redHJ force-pushed the changeScript branch 3 times, most recently from 077a5d8 to 2ec10ce Compare May 22, 2018 10:06
Comment thread transforms/mutate/script.go Outdated
if len(GetKeys(key)) <= 0 {
continue
}
keysDetail = append(keysDetail, GetKeys(key))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

程序员的自我修养

@wonderflow

Copy link
Copy Markdown
Contributor

LGTM

@wonderflow
wonderflow merged commit 6b37f90 into qiniu:master May 22, 2018
@redHJ
redHJ deleted the changeScript branch January 10, 2019 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants