Skip to content

Commit

Permalink
Go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jdextraze committed Nov 5, 2017
1 parent ffab78e commit ef50b3b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
1 change: 1 addition & 0 deletions client/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
)

// TODO review those
var (
WrongExpectedVersion = errors.New("Wrong expected version")
StreamDeleted = errors.New("Stream deleted")
Expand Down
16 changes: 8 additions & 8 deletions client/transaction.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package client

import (
"github.com/jdextraze/go-gesclient/tasks"
"errors"
"github.com/jdextraze/go-gesclient/tasks"
)

type Transaction struct {
transactionId int64
transactionId int64
userCredentials *UserCredentials
connection TransactionConnection
isRolledBack bool
isCommitted bool
connection TransactionConnection
isRolledBack bool
isCommitted bool
}

type TransactionConnection interface {
Expand All @@ -20,7 +20,7 @@ type TransactionConnection interface {

var (
CannotCommitRolledBackTransaction = errors.New("cannot commit a rolled back transaction")
TransactionIsAlreadyCommitted = errors.New("transaction is already committed")
TransactionIsAlreadyCommitted = errors.New("transaction is already committed")
)

func NewTransaction(
Expand All @@ -33,9 +33,9 @@ func NewTransaction(
}

return &Transaction{
transactionId: transactionId,
transactionId: transactionId,
userCredentials: userCredentials,
connection: connection,
connection: connection,
}
}

Expand Down
6 changes: 3 additions & 3 deletions operations/commit_transaction.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package operations

import (
"github.com/jdextraze/go-gesclient/tasks"
"github.com/jdextraze/go-gesclient/client"
"fmt"
"github.com/golang/protobuf/proto"
"github.com/jdextraze/go-gesclient/client"
"github.com/jdextraze/go-gesclient/messages"
"fmt"
"github.com/jdextraze/go-gesclient/tasks"
)

type CommitTransaction struct {
Expand Down
6 changes: 3 additions & 3 deletions operations/start_transaction.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package operations

import (
"github.com/jdextraze/go-gesclient/client"
"github.com/jdextraze/go-gesclient/tasks"
"fmt"
"github.com/golang/protobuf/proto"
"github.com/jdextraze/go-gesclient/client"
"github.com/jdextraze/go-gesclient/messages"
"fmt"
"github.com/jdextraze/go-gesclient/tasks"
)

type StartTransaction struct {
Expand Down
20 changes: 10 additions & 10 deletions operations/transactional_write.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package operations

import (
"github.com/jdextraze/go-gesclient/tasks"
"github.com/jdextraze/go-gesclient/client"
"fmt"
"github.com/golang/protobuf/proto"
"github.com/jdextraze/go-gesclient/client"
"github.com/jdextraze/go-gesclient/messages"
"fmt"
"github.com/jdextraze/go-gesclient/tasks"
)

type TransactionalWrite struct {
Expand Down Expand Up @@ -36,26 +36,26 @@ func (o *TransactionalWrite) createRequestDto() proto.Message {
events := make([]*messages.NewEvent, len(o.events))
for i, e := range o.events {
var (
dataContentType int32
dataContentType int32
metadataContentType int32
)
eventType := e.Type()
if e.IsJson() {
dataContentType = 1
}
events[i] = &messages.NewEvent{
EventId: e.EventId().Bytes(),
EventType: &eventType,
DataContentType: &dataContentType,
EventId: e.EventId().Bytes(),
EventType: &eventType,
DataContentType: &dataContentType,
MetadataContentType: &metadataContentType,
Data: e.Data(),
Metadata: e.Metadata(),
Data: e.Data(),
Metadata: e.Metadata(),
}
}
return &messages.TransactionWrite{
TransactionId: &o.transactionId,
RequireMaster: &o.requireMaster,
Events: events,
Events: events,
}
}

Expand Down

0 comments on commit ef50b3b

Please sign in to comment.