Skip to content

Commit

Permalink
Fix some Go Report Card warnings (googleforgames#162)
Browse files Browse the repository at this point in the history
* fix misspell
* add err check and fix var shadowing
* fix crd package comment
  • Loading branch information
dvrkps authored and fooock committed Apr 6, 2018
1 parent b054b3d commit 6192abd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions examples/simple-udp/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,20 @@ func main() {
if err != nil {
log.Fatalf("Could not connect: %v", err)
}
defer conn.Close()

defer func() {
err = conn.Close()
if err != nil {
log.Fatalf("Could not close connection: %v", err)
}
}()

go func() {
b := make([]byte, bufferSize)
for {
n, err := conn.Read(b)
if err != nil {
log.Fatalf("Could not read packet: %v", err)
n, errRead := conn.Read(b)
if errRead != nil {
log.Fatalf("Could not read packet: %v", errRead)
}
log.Printf("Received Packet: %s", b[:n])
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/util/crd/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// package crd contains utilities for working with
// CustomResourceDefinitions
// Package crd contains utilities for working with
// CustomResourceDefinitions.
package crd

import (
Expand Down

0 comments on commit 6192abd

Please sign in to comment.