Skip to content

Commit

Permalink
Use stdlib context
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorix committed Feb 17, 2017
1 parent b0126b9 commit 2c5aedc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
5 changes: 3 additions & 2 deletions wsdlgo/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ func (ge *goEncoder) writeGoFuncs(w io.Writer, d *wsdl.Definitions) error {
ok := ge.writeSOAPFunc(w, d, op, in, out, ret, outParams[0].xmlToken)
if !ok {
ge.needsStdPkg["errors"] = true
ge.needsExtPkg["golang.org/x/net/context"] = true
ge.needsStdPkg["context"] = true
in = append([]string{"ctx context.Context"}, in...)
ge.fixParamConflicts(in, out)
fn := ge.fixFuncNameConflicts(strings.Title(op.Name))
Expand Down Expand Up @@ -503,7 +503,8 @@ func (ge *goEncoder) writeSOAPFunc(w io.Writer, d *wsdl.Definitions, op *wsdl.Op
if _, exists := ge.soapOps[op.Name]; !exists {
return false
}
if len(in) != 1 || len(out) != 2 {
// TODO: handle other input params: e.g. SOAP headers.
if len(in) < 1 || len(out) != 2 {
return false
}
ge.needsStdPkg["encoding/xml"] = true
Expand Down
3 changes: 1 addition & 2 deletions wsdlgo/testdata/tpexample1.golden
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package hello_binding

import (
"errors"

"golang.org/x/net/context"
"context"
)

// SayHello was auto-generated from WSDL.
Expand Down
3 changes: 1 addition & 2 deletions wsdlgo/testdata/w3cexample1.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package internal

import (
"context"
"errors"

"golang.org/x/net/context"
)

// GetTerm was auto-generated from WSDL.
Expand Down
3 changes: 1 addition & 2 deletions wsdlgo/testdata/w3cexample2.golden
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package internal

import (
"context"
"errors"

"golang.org/x/net/context"
)

// SetTerm was auto-generated from WSDL.
Expand Down

0 comments on commit 2c5aedc

Please sign in to comment.