Skip to content

Commit ab81397

Browse files
authored
Merge pull request #221 from figo/master
BuildJob accept map as argument rather than a slice
2 parents 980672b + 27e7500 commit ab81397

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ if err != nil {
4545
panic("Something Went Wrong")
4646
}
4747

48-
queueid, err := jenkins.BuildJob(ctx, "#jobname")
48+
queueid, err := jenkins.BuildJob(ctx, "#jobname", nil)
4949
if err != nil {
5050
panic(err)
5151
}

jenkins.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,8 @@ func (j *Jenkins) DeleteJob(ctx context.Context, name string) (bool, error) {
267267
// Invoke a job.
268268
// First parameter job name, second parameter is optional Build parameters.
269269
// Returns queue id
270-
func (j *Jenkins) BuildJob(ctx context.Context, name string, options ...interface{}) (int64, error) {
270+
func (j *Jenkins) BuildJob(ctx context.Context, name string, params map[string]string) (int64, error) {
271271
job := Job{Jenkins: j, Raw: new(JobResponse), Base: "/job/" + name}
272-
var params map[string]string
273-
if len(options) > 0 {
274-
params, _ = options[0].(map[string]string)
275-
}
276272
return job.InvokeSimple(ctx, params)
277273
}
278274

0 commit comments

Comments
 (0)