소스 검색

pipoint: run gofmt -s

Michael Hope 8 달 전
부모
커밋
1b13f34b3b
7개의 변경된 파일12개의 추가작업 그리고 13개의 파일을 삭제
  1. 2 0
      etc/extras.txt
  2. 3 3
      orientate.go
  3. 0 1
      param.go
  4. 1 1
      param_test.go
  5. 0 1
      run.go
  6. 6 6
      util.go
  7. 0 1
      util_test.go

+ 2 - 0
etc/extras.txt 파일 보기

@@ -1,3 +1,5 @@
1 1
 mavlink stop-all
2 2
 mavlink start -b 57600 -m custom -x
3 3
 mavlink stream -r 5 -d /dev/ttyS1 -s GPS_RAW_INT
4
+mavlink stream -r 2 -d /dev/ttyS1 -s RC_CHANNELS
5
+mavlink stream -r 1 -d /dev/ttyS1 -s SYS_STATUS

+ 3 - 3
orientate.go 파일 보기

@@ -18,7 +18,7 @@ package pipoint
18 18
 // OrientateState runs to set the pan orientation.
19 19
 type OrientateState struct {
20 20
 	name string
21
-	pi *PiPoint
21
+	pi   *PiPoint
22 22
 }
23 23
 
24 24
 func (s *OrientateState) Name() string {
@@ -37,7 +37,7 @@ func (s *OrientateState) Update(param *Param) {
37 37
 	if param != s.pi.rover {
38 38
 		return
39 39
 	}
40
-	
40
+
41 41
 	if !s.pi.rover.Ok() || !s.pi.base.Ok() {
42 42
 		return
43 43
 	}
@@ -54,7 +54,7 @@ func (s *OrientateState) Update(param *Param) {
54 54
 
55 55
 	current := s.pi.offset.Get().(*Attitude)
56 56
 	s.pi.offset.Set(&Attitude{
57
-		Yaw: -att.Yaw,
57
+		Yaw:   -att.Yaw,
58 58
 		Pitch: current.Pitch,
59 59
 	})
60 60
 }

+ 0 - 1
param.go 파일 보기

@@ -76,7 +76,6 @@ func isNumber(value interface{}) bool {
76 76
 	return err == nil
77 77
 }
78 78
 
79
-
80 79
 // Set the value, update validity, and notify listeners.
81 80
 func (p *Param) Set(value interface{}) error {
82 81
 	if p.value == nil {

+ 1 - 1
param_test.go 파일 보기

@@ -48,7 +48,7 @@ func TestParamListen(t *testing.T) {
48 48
 
49 49
 	close(ch)
50 50
 
51
-	for p := range(ch) {
51
+	for p := range ch {
52 52
 		hits++
53 53
 		val = p
54 54
 	}

+ 0 - 1
run.go 파일 보기

@@ -54,7 +54,6 @@ func (s *RunState) Update(param *Param) {
54 54
 		return
55 55
 	}
56 56
 
57
-	
58 57
 	rover := s.pi.rover.Get().(*NEUPosition)
59 58
 	base := s.pi.base.Get().(*NEUPosition)
60 59
 	baseOffset := s.pi.baseOffset.Get().(*NEUPosition)

+ 6 - 6
util.go 파일 보기

@@ -16,13 +16,13 @@
16 16
 package pipoint
17 17
 
18 18
 import (
19
-	"math"
20
-	"time"
21
-	"encoding/hex"
22 19
 	"crypto/sha1"
23
-	"strings"
24
-	"regexp"
20
+	"encoding/hex"
25 21
 	"io"
22
+	"math"
23
+	"regexp"
24
+	"strings"
25
+	"time"
26 26
 )
27 27
 
28 28
 // Scale from one range to another.
@@ -70,7 +70,7 @@ func NormText(text string) string {
70 70
 	hashed := sha1.New()
71 71
 	io.WriteString(hashed, text)
72 72
 	summary := hex.EncodeToString(hashed.Sum(nil))[:4]
73
-	
73
+
74 74
 	norm := text
75 75
 	if len(norm) > 20 {
76 76
 		norm = norm[:20]

+ 0 - 1
util_test.go 파일 보기

@@ -29,7 +29,6 @@ func TestNormText(t *testing.T) {
29 29
 	assert.Equal(t, NormText("Lots%of--crazy"),
30 30
 		"lots_of__crazy-4921")
31 31
 
32
-	
33 32
 	// No collisions.
34 33
 	assert.Equal(t, NormText("Rover online"),
35 34
 		"rover_online-f40c")