Skip to content

Commit

Permalink
Fix trivial go vet problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
huin committed Jul 4, 2021
1 parent 33cdcbb commit a666909
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions example/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

// Use discovered WANPPPConnection1 services to find external IP addresses.
func Example_WANPPPConnection1_GetExternalIPAddress() {
func ExampleWANPPPConnection1_GetExternalIPAddress() {
clients, errors, err := internetgateway1.NewWANPPPConnection1Clients()
extIPClients := make([]GetExternalIPAddresser, len(clients))
for i, client := range clients {
Expand All @@ -22,7 +22,7 @@ func Example_WANPPPConnection1_GetExternalIPAddress() {
}

// Use discovered WANIPConnection services to find external IP addresses.
func Example_WANIPConnection_GetExternalIPAddress() {
func ExampleWANIPConnection1_GetExternalIPAddress() {
clients, errors, err := internetgateway1.NewWANIPConnection1Clients()
extIPClients := make([]GetExternalIPAddresser, len(clients))
for i, client := range clients {
Expand Down Expand Up @@ -63,7 +63,7 @@ func DisplayExternalIPResults(clients []GetExternalIPAddresser, errors []error,
}
}

func Example_ReuseDiscoveredDevice() {
func Example_reuseDiscoveredDevice() {
var allMaybeRootDevices []goupnp.MaybeRootDevice
for _, urn := range []string{internetgateway1.URN_WANPPPConnection_1, internetgateway1.URN_WANIPConnection_1} {
maybeRootDevices, err := goupnp.DiscoverDevices(internetgateway1.URN_WANPPPConnection_1)
Expand Down Expand Up @@ -95,7 +95,7 @@ func Example_ReuseDiscoveredDevice() {

// Use discovered igd1.WANCommonInterfaceConfig1 services to discover byte
// transfer counts.
func Example_WANCommonInterfaceConfig1_GetBytesTransferred() {
func ExampleWANCommonInterfaceConfig1_getBytesTransferred_internetgateway1() {
clients, errors, err := internetgateway1.NewWANCommonInterfaceConfig1Clients()
if err != nil {
fmt.Fprintln(os.Stderr, "Error discovering service with UPnP:", err)
Expand All @@ -122,7 +122,7 @@ func Example_WANCommonInterfaceConfig1_GetBytesTransferred() {

// Use discovered igd2.WANCommonInterfaceConfig1 services to discover byte
// transfer counts.
func Example_WANCommonInterfaceConfig2_GetBytesTransferred() {
func ExampleWANCommonInterfaceConfig1_getBytesTransferred_internetgateway2() {
clients, errors, err := internetgateway2.NewWANCommonInterfaceConfig1Clients()
if err != nil {
fmt.Fprintln(os.Stderr, "Error discovering service with UPnP:", err)
Expand Down
2 changes: 1 addition & 1 deletion soap/soap.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func encodeRequestArgs(w *bytes.Buffer, inAction interface{}) error {
if value.Kind() != reflect.String {
return fmt.Errorf("goupnp: SOAP arg %q is not of type string, but of type %v", argName, value.Type())
}
elem := xml.StartElement{xml.Name{"", argName}, nil}
elem := xml.StartElement{Name: xml.Name{Space: "", Local: argName}, Attr: nil}
if err := enc.EncodeToken(elem); err != nil {
return fmt.Errorf("goupnp: error encoding start element for SOAP arg %q: %v", argName, err)
}
Expand Down

0 comments on commit a666909

Please sign in to comment.