Skip to content

Commit 07f0657

Browse files
committedAug 6, 2014
goimports -w
1 parent d6dbcb4 commit 07f0657

File tree

7 files changed

+40
-38
lines changed

7 files changed

+40
-38
lines changed
 

‎builder_test.go

+28-27
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import (
44
. "github.com/sdboyer/gocheck"
55
)
66

7-
type SpecTestSuite struct {}
7+
type SpecTestSuite struct{}
8+
89
var _ = Suite(&SpecTestSuite{})
910

1011
const baseline = G_UNDIRECTED | G_SIMPLE | G_BASIC | G_MUTABLE
@@ -26,67 +27,67 @@ func (s *SpecTestSuite) permuteField() []GraphProperties {
2627
func (s *SpecTestSuite) TestMutators(c *C) {
2728
var spec GraphSpec
2829
for _, spec.Props = range s.permuteField() {
29-
c.Assert(spec.Directed().Props & G_DIRECTED == G_DIRECTED, Equals, true)
30-
c.Assert(spec.Directed().Props & G_UNDIRECTED == 0, Equals, true)
30+
c.Assert(spec.Directed().Props&G_DIRECTED == G_DIRECTED, Equals, true)
31+
c.Assert(spec.Directed().Props&G_UNDIRECTED == 0, Equals, true)
3132
}
3233

3334
for _, spec.Props = range s.permuteField() {
34-
c.Assert(spec.Undirected().Props & G_UNDIRECTED == G_UNDIRECTED, Equals, true)
35-
c.Assert(spec.Undirected().Props & G_DIRECTED == 0, Equals, true)
35+
c.Assert(spec.Undirected().Props&G_UNDIRECTED == G_UNDIRECTED, Equals, true)
36+
c.Assert(spec.Undirected().Props&G_DIRECTED == 0, Equals, true)
3637
}
3738

3839
for _, spec.Props = range s.permuteField() {
39-
c.Assert(spec.Basic().Props & G_BASIC == G_BASIC, Equals, true)
40-
c.Assert(spec.Basic().Props & (G_LABELED | G_WEIGHTED | G_DATA) == 0, Equals, true)
40+
c.Assert(spec.Basic().Props&G_BASIC == G_BASIC, Equals, true)
41+
c.Assert(spec.Basic().Props&(G_LABELED|G_WEIGHTED|G_DATA) == 0, Equals, true)
4142
}
4243

4344
for _, spec.Props = range s.permuteField() {
44-
c.Assert(spec.Labeled().Props & G_LABELED == G_LABELED, Equals, true)
45-
c.Assert(spec.Labeled().Props & G_BASIC == 0, Equals, true)
45+
c.Assert(spec.Labeled().Props&G_LABELED == G_LABELED, Equals, true)
46+
c.Assert(spec.Labeled().Props&G_BASIC == 0, Equals, true)
4647
}
4748

4849
for _, spec.Props = range s.permuteField() {
49-
c.Assert(spec.Weighted().Props & G_WEIGHTED == G_WEIGHTED, Equals, true)
50-
c.Assert(spec.Weighted().Props & G_BASIC == 0, Equals, true)
50+
c.Assert(spec.Weighted().Props&G_WEIGHTED == G_WEIGHTED, Equals, true)
51+
c.Assert(spec.Weighted().Props&G_BASIC == 0, Equals, true)
5152
}
5253

5354
for _, spec.Props = range s.permuteField() {
54-
c.Assert(spec.DataEdges().Props & G_DATA == G_DATA, Equals, true)
55-
c.Assert(spec.DataEdges().Props & G_BASIC == 0, Equals, true)
55+
c.Assert(spec.DataEdges().Props&G_DATA == G_DATA, Equals, true)
56+
c.Assert(spec.DataEdges().Props&G_BASIC == 0, Equals, true)
5657
}
5758

5859
for _, spec.Props = range s.permuteField() {
59-
c.Assert(spec.SimpleGraph().Props & G_SIMPLE == G_SIMPLE, Equals, true)
60-
c.Assert(spec.SimpleGraph().Props & (G_LOOPS | G_PARALLEL) == 0, Equals, true)
60+
c.Assert(spec.SimpleGraph().Props&G_SIMPLE == G_SIMPLE, Equals, true)
61+
c.Assert(spec.SimpleGraph().Props&(G_LOOPS|G_PARALLEL) == 0, Equals, true)
6162
}
6263

6364
for _, spec.Props = range s.permuteField() {
64-
c.Assert(spec.MultiGraph().Props & G_PARALLEL == G_PARALLEL, Equals, true)
65-
c.Assert(spec.MultiGraph().Props & (G_LOOPS | G_SIMPLE) == 0, Equals, true)
65+
c.Assert(spec.MultiGraph().Props&G_PARALLEL == G_PARALLEL, Equals, true)
66+
c.Assert(spec.MultiGraph().Props&(G_LOOPS|G_SIMPLE) == 0, Equals, true)
6667
}
6768

6869
for _, spec.Props = range s.permuteField() {
69-
c.Assert(spec.PseudoGraph().Props & (G_LOOPS | G_PARALLEL) == (G_LOOPS | G_PARALLEL), Equals, true)
70-
c.Assert(spec.PseudoGraph().Props & G_SIMPLE == 0, Equals, true)
70+
c.Assert(spec.PseudoGraph().Props&(G_LOOPS|G_PARALLEL) == (G_LOOPS|G_PARALLEL), Equals, true)
71+
c.Assert(spec.PseudoGraph().Props&G_SIMPLE == 0, Equals, true)
7172
}
7273

7374
for _, spec.Props = range s.permuteField() {
74-
c.Assert(spec.Parallel().Props & G_PARALLEL == G_PARALLEL, Equals, true)
75-
c.Assert(spec.Parallel().Props & G_SIMPLE == 0, Equals, true)
75+
c.Assert(spec.Parallel().Props&G_PARALLEL == G_PARALLEL, Equals, true)
76+
c.Assert(spec.Parallel().Props&G_SIMPLE == 0, Equals, true)
7677
}
7778

7879
for _, spec.Props = range s.permuteField() {
79-
c.Assert(spec.Loop().Props & G_LOOPS == G_LOOPS, Equals, true)
80-
c.Assert(spec.Loop().Props & G_SIMPLE == 0, Equals, true)
80+
c.Assert(spec.Loop().Props&G_LOOPS == G_LOOPS, Equals, true)
81+
c.Assert(spec.Loop().Props&G_SIMPLE == 0, Equals, true)
8182
}
8283

8384
for _, spec.Props = range s.permuteField() {
84-
c.Assert(spec.Mutable().Props & G_MUTABLE == G_MUTABLE, Equals, true)
85-
c.Assert(spec.Mutable().Props & G_IMMUTABLE == 0, Equals, true)
85+
c.Assert(spec.Mutable().Props&G_MUTABLE == G_MUTABLE, Equals, true)
86+
c.Assert(spec.Mutable().Props&G_IMMUTABLE == 0, Equals, true)
8687
}
8788

8889
for _, spec.Props = range s.permuteField() {
89-
c.Assert(spec.Immutable().Props & G_IMMUTABLE == G_IMMUTABLE, Equals, true)
90-
c.Assert(spec.Immutable().Props & G_MUTABLE == 0, Equals, true)
90+
c.Assert(spec.Immutable().Props&G_IMMUTABLE == G_IMMUTABLE, Equals, true)
91+
c.Assert(spec.Immutable().Props&G_MUTABLE == 0, Equals, true)
9192
}
9293
}

‎edge_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
)
99

1010
type EdgeListSuite struct{}
11+
1112
var _ = Suite(&EdgeListSuite{})
1213

1314
func (s *EdgeListSuite) TestEachVertex(c *C) {
@@ -79,6 +80,7 @@ func (s *EdgeListSuite) TestEachEdgeTermination(c *C) {
7980
}
8081

8182
type EdgeSuite struct{}
83+
8284
var _ = Suite(&EdgeSuite{})
8385

8486
func (s *EdgeSuite) TestEdges(c *C) {

‎graph/al/al.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package al
22

33
import (
4-
. "github.com/sdboyer/gogl"
54
"sync"
5+
. "github.com/sdboyer/gogl"
66
)
77

88
/*

‎graph/al/directed.go

+1
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ func (g *mutableDirected) addArcs(arcs ...Arc) {
217217
}
218218
}
219219
}
220+
220221
// Removes arcs from the graph. This does NOT remove vertex members of the
221222
// removed arcs.
222223
func (g *mutableDirected) RemoveArcs(arcs ...Arc) {

‎graph/al/labeled.go

-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,6 @@ func (g *labeledUndirected) addEdges(edges ...LabeledEdge) {
502502
u, v := edge.Both()
503503
g.ensureVertex(u, v)
504504

505-
506505
if _, exists := g.list[u][v]; !exists {
507506
l := edge.Label()
508507
g.list[u][v] = l

‎rand/bernoulli.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ func BernoulliDistribution(n uint, ρ float64, directed bool, stable bool, src s
6060
type bTrial func(ρ float64) bool
6161

6262
type stableBernoulliGraph struct {
63-
order uint
64-
ρ float64
65-
trial bTrial
66-
size int
67-
list [][]bool
63+
order uint
64+
ρ float64
65+
trial bTrial
66+
size int
67+
list [][]bool
6868
}
6969

7070
func (g *stableBernoulliGraph) EachVertex(f gogl.VertexStep) {
@@ -181,9 +181,9 @@ func (g *stableBernoulliDigraph) EachArc(f gogl.ArcStep) {
181181
}
182182

183183
type unstableBernoulliGraph struct {
184-
order uint
185-
ρ float64
186-
trial bTrial
184+
order uint
185+
ρ float64
186+
trial bTrial
187187
}
188188

189189
func (g unstableBernoulliGraph) EachVertex(f gogl.VertexStep) {

‎rand/bernoulli_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,3 @@ func (s *BernoulliTest) TestEachArcTermination(c *C) {
216216
})
217217
c.Assert(hit, Equals, 3)
218218
}
219-

0 commit comments

Comments
 (0)
Please sign in to comment.