Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasinsaurralde committed Jun 6, 2016
1 parent 27e31f9 commit 32137af
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
3 changes: 1 addition & 2 deletions marshalers/brotli.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ func (marshaler BrotliMarshaler) Unmarshal(i *interface{}) (error, interface{})
return err, nil
}


var inputBuf []byte
inputBuf = (*i).([]byte)

buf, err := dec.DecompressBuffer( inputBuf, make([]byte, 0))
buf, err := dec.DecompressBuffer(inputBuf, make([]byte, 0))

return err, buf
}
4 changes: 2 additions & 2 deletions marshalers/brotli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ func TestBrotliUnmarshalChain(t *testing.T) {
err, unmarshalOutput := chain.Unmarshal(i)

if err != nil {
t.Fatal( err )
t.Fatal(err)
}

var protoOutput *transportsProto.HttpRequest
protoOutput = unmarshalOutput.(*transportsProto.HttpRequest)

if protoOutput.GetUrl() != "http://whatismyip.akamai.com/" {
t.Fatal( "Protobuffer field doesn't have the original HttpRequest value")
t.Fatal("Protobuffer field doesn't have the original HttpRequest value")
}

}
Expand Down
26 changes: 13 additions & 13 deletions marshalers/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,19 @@ func (s *ChainData) process(reverseOrder bool) (error, interface{}) {
log.Println("--> Chain step #", i)
if output == nil {
log.Println("No previous output, starting chain")
if reverseOrder {
err, output = m.Unmarshal(&s.input)
} else {
err, output = m.Marshal(&s.input)
}
if reverseOrder {
err, output = m.Unmarshal(&s.input)
} else {
err, output = m.Marshal(&s.input)
}
log.Println("First output:", output, "Error:", err)
} else {
log.Println("Previous output", output)
if reverseOrder {
err, output = m.Unmarshal(&output)
} else {
err, output = m.Marshal(&output)
}
if reverseOrder {
err, output = m.Unmarshal(&output)
} else {
err, output = m.Marshal(&output)
}
log.Println("New output:", output, "Error:", err)
}

Expand All @@ -72,9 +72,9 @@ func (s *ChainData) process(reverseOrder bool) (error, interface{}) {

}

if output == nil {
err = errors.New(ChainNilOutput)
}
if output == nil {
err = errors.New(ChainNilOutput)
}

return err, output
}
Expand Down
4 changes: 2 additions & 2 deletions marshalers/chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ func init() {

func TestBasicChaining(t *testing.T) {
err, chain := transports.NewChain(
transports.DummyMarshaler{},
transports.DummyMarshaler{},
)
transports.DummyMarshaler{},
)

if err != nil {
t.Fatal(err)
Expand Down

0 comments on commit 32137af

Please sign in to comment.