Explorar el Código

run go fmt, add .lbox.check

There were a couple of files that were changed by
running "go fmt", and I noticed there wasn't a
.lbox.check file. I'm guessing goyaml predated
the functionality in lbox. So I ran the tool,
and added the check file. No functional changes.

R=niemeyer
CC=
https://codereview.appspot.com/7801047
John A Meinel hace 13 años
padre
commit
731788bc8b
Se han modificado 3 ficheros con 21 adiciones y 2 borrados
  1. 20 0
      .lbox.check
  2. 0 1
      resolve.go
  3. 1 1
      sorter.go

+ 20 - 0
.lbox.check

@@ -0,0 +1,20 @@
+#!/bin/sh
+
+set -e
+
+BADFMT=`find * -name '*.go' | xargs gofmt -l`
+if [ -n "$BADFMT" ]; then
+	BADFMT=`echo "$BADFMT" | sed "s/^/  /"`
+	echo -e "gofmt is sad:\n\n$BADFMT"
+	exit 1
+fi
+
+VERSION=`go version | awk '{print $3}'`
+if [ $VERSION == 'devel' ]; then
+	go tool vet \
+		-methods \
+		-printf \
+		-rangeloops \
+		-printfuncs 'ErrorContextf:1,notFoundf:0,badReqErrorf:0,Commitf:0,Snapshotf:0,Debugf:0' \
+		.
+fi

+ 0 - 1
resolve.go

@@ -8,7 +8,6 @@ import (
 
 // TODO: merge, timestamps, base 60 floats, omap.
 
-
 type resolveMapItem struct {
 	value interface{}
 	tag   string

+ 1 - 1
sorter.go

@@ -7,7 +7,7 @@ import (
 
 type keyList []reflect.Value
 
-func (l keyList) Len() int { return len(l) }
+func (l keyList) Len() int      { return len(l) }
 func (l keyList) Swap(i, j int) { l[i], l[j] = l[j], l[i] }
 func (l keyList) Less(i, j int) bool {
 	a := l[i]