Skip to content

Commit

Permalink
add "DO NOT EDIT" header to generated file
Browse files Browse the repository at this point in the history
  • Loading branch information
costela authored and fiorix committed Jul 13, 2019
1 parent ecea26b commit a93e82f
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion wsdlgo/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import (
"golang.org/x/net/html/charset"
)

const fileHeader = "// Code generated by wsdl2go. DO NOT EDIT."

// An Encoder generates Go code from WSDL definitions.
type Encoder interface {
// Encode generates Go code from d.
Expand Down Expand Up @@ -224,7 +226,7 @@ func (ge *goEncoder) encode(w io.Writer, d *wsdl.Definitions) error {
}
}

fmt.Fprintf(w, "package %s\n\nimport (\n", ge.packageName)
fmt.Fprintf(w, "%s\n\npackage %s\n\nimport (\n", fileHeader, ge.packageName)
for pkg := range ge.needsStdPkg {
fmt.Fprintf(w, "%q\n", pkg)
}
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/arrayexample.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package stockquotesoapbinding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/data.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package dataendpointhttpbinding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/data_withkeyword.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package dataendpointhttpbinding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/localimport.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package stockquotesoapbinding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/localimport_choice.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package stockquotesoapbinding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/memcache.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package memoryservice

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/soap12wcf.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package testsoap12binding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/tpexample1.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package hello_binding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/w3cexample1.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package internal

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/w3cexample2.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package internal

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/w3example1.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package endorsementsearchsoapbinding

import (
Expand Down
2 changes: 2 additions & 0 deletions wsdlgo/testdata/w3example2.golden
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Code generated by wsdl2go. DO NOT EDIT.

package stockquotesoapbinding

import (
Expand Down

0 comments on commit a93e82f

Please sign in to comment.