Ran gofmt on project.

This commit is contained in:
Pradyumna Kaushik 2017-12-21 12:50:40 -08:00
parent 65d92e9962
commit 1e71db7b31
17 changed files with 15 additions and 28 deletions

View file

@ -16,9 +16,10 @@ package realis_test
import ( import (
"fmt" "fmt"
"github.com/stretchr/testify/assert"
"testing" "testing"
"github.com/paypal/gorealis" "github.com/paypal/gorealis"
"github.com/stretchr/testify/assert"
) )
func TestLoadClusters(t *testing.T) { func TestLoadClusters(t *testing.T) {

View file

@ -196,7 +196,7 @@ func main() {
} }
fmt.Println(resp.String()) fmt.Println(resp.String())
if ok, err := monitor.JobUpdate(*resp.GetKey(), 5, 50); !ok || err != nil { if ok, err := monitor.JobUpdate(*resp.GetKey(), 5, 50); !ok || err != nil {
_, err := r.KillJob(job.JobKey()) _, err := r.KillJob(job.JobKey())
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)

1
job.go
View file

@ -87,7 +87,6 @@ func NewJob() Job {
taskConfig.Resources[ramMb] = true taskConfig.Resources[ramMb] = true
taskConfig.Resources[diskMb] = true taskConfig.Resources[diskMb] = true
numCpus.NumCpus = new(float64) numCpus.NumCpus = new(float64)
ramMb.RamMb = new(int64) ramMb.RamMb = new(int64)
diskMb.DiskMb = new(int64) diskMb.DiskMb = new(int64)

View file

@ -18,8 +18,8 @@ package response
import ( import (
"bytes" "bytes"
"github.com/pkg/errors"
"github.com/paypal/gorealis/gen-go/apache/aurora" "github.com/paypal/gorealis/gen-go/apache/aurora"
"github.com/pkg/errors"
) )
// Get key from a response created by a StartJobUpdate call // Get key from a response created by a StartJobUpdate call

View file

@ -24,8 +24,6 @@ type UpdateJob struct {
req *aurora.JobUpdateRequest req *aurora.JobUpdateRequest
} }
// Create a default UpdateJob object. // Create a default UpdateJob object.
func NewDefaultUpdateJob(config *aurora.TaskConfig) *UpdateJob { func NewDefaultUpdateJob(config *aurora.TaskConfig) *UpdateJob {
@ -141,7 +139,6 @@ func (u *UpdateJob) RollbackOnFail(rollback bool) *UpdateJob {
return u return u
} }
// TODO(rdelvalle): Integrate this struct with the JobUpdate struct so that we don't repeat code // TODO(rdelvalle): Integrate this struct with the JobUpdate struct so that we don't repeat code
type UpdateSettings struct { type UpdateSettings struct {
settings aurora.JobUpdateSettings settings aurora.JobUpdateSettings

View file

@ -48,7 +48,7 @@ func NewTFramedTransportFactory(factory TTransportFactory) TTransportFactory {
} }
func NewTFramedTransportFactoryMaxLength(factory TTransportFactory, maxLength uint32) TTransportFactory { func NewTFramedTransportFactoryMaxLength(factory TTransportFactory, maxLength uint32) TTransportFactory {
return &tFramedTransportFactory{factory: factory, maxLength: maxLength} return &tFramedTransportFactory{factory: factory, maxLength: maxLength}
} }
func (p *tFramedTransportFactory) GetTransport(base TTransport) TTransport { func (p *tFramedTransportFactory) GetTransport(base TTransport) TTransport {
@ -164,4 +164,3 @@ func (p *TFramedTransport) readFrameHeader() (uint32, error) {
func (p *TFramedTransport) RemainingBytes() (num_bytes uint64) { func (p *TFramedTransport) RemainingBytes() (num_bytes uint64) {
return uint64(p.frameSize) return uint64(p.frameSize)
} }

View file

@ -209,6 +209,5 @@ func (p *StreamTransport) WriteString(s string) (n int, err error) {
func (p *StreamTransport) RemainingBytes() (num_bytes uint64) { func (p *StreamTransport) RemainingBytes() (num_bytes uint64) {
const maxSize = ^uint64(0) const maxSize = ^uint64(0)
return maxSize // the thruth is, we just don't know unless framed is used return maxSize // the thruth is, we just don't know unless framed is used
} }

View file

@ -90,8 +90,8 @@ func SkipDefaultDepth(prot TProtocol, typeId TType) (err error) {
// Skips over the next data element from the provided input TProtocol object. // Skips over the next data element from the provided input TProtocol object.
func Skip(self TProtocol, fieldType TType, maxDepth int) (err error) { func Skip(self TProtocol, fieldType TType, maxDepth int) (err error) {
if maxDepth <= 0 { if maxDepth <= 0 {
return NewTProtocolExceptionWithType( DEPTH_LIMIT, errors.New("Depth limit exceeded")) return NewTProtocolExceptionWithType(DEPTH_LIMIT, errors.New("Depth limit exceeded"))
} }
switch fieldType { switch fieldType {

View file

@ -60,7 +60,7 @@ func NewTProtocolException(err error) TProtocolException {
if err == nil { if err == nil {
return nil return nil
} }
if e,ok := err.(TProtocolException); ok { if e, ok := err.(TProtocolException); ok {
return e return e
} }
if _, ok := err.(base64.CorruptInputError); ok { if _, ok := err.(base64.CorruptInputError); ok {
@ -75,4 +75,3 @@ func NewTProtocolExceptionWithType(errType int, err error) TProtocolException {
} }
return &tProtocolException{errType, err.Error()} return &tProtocolException{errType, err.Error()}
} }

View file

@ -66,4 +66,3 @@ func writeByte(w io.Writer, c byte) error {
_, err := w.Write(v[0:1]) _, err := w.Write(v[0:1])
return err return err
} }

View file

@ -188,7 +188,7 @@ func (p *TSimpleServer) processRequests(client TTransport) error {
if err, ok := err.(TApplicationException); ok && err.TypeId() == UNKNOWN_METHOD { if err, ok := err.(TApplicationException); ok && err.TypeId() == UNKNOWN_METHOD {
continue continue
} }
if !ok { if !ok {
break break
} }
} }

View file

@ -161,6 +161,5 @@ func (p *TSocket) Interrupt() error {
func (p *TSocket) RemainingBytes() (num_bytes uint64) { func (p *TSocket) RemainingBytes() (num_bytes uint64) {
const maxSize = ^uint64(0) const maxSize = ^uint64(0)
return maxSize // the thruth is, we just don't know unless framed is used return maxSize // the thruth is, we just don't know unless framed is used
} }

View file

@ -20,9 +20,9 @@
package thrift package thrift
import ( import (
"crypto/tls"
"net" "net"
"time" "time"
"crypto/tls"
) )
type TSSLServerSocket struct { type TSSLServerSocket struct {

View file

@ -166,6 +166,5 @@ func (p *TSSLSocket) Interrupt() error {
func (p *TSSLSocket) RemainingBytes() (num_bytes uint64) { func (p *TSSLSocket) RemainingBytes() (num_bytes uint64) {
const maxSize = ^uint64(0) const maxSize = ^uint64(0)
return maxSize // the thruth is, we just don't know unless framed is used return maxSize // the thruth is, we just don't know unless framed is used
} }

View file

@ -34,7 +34,6 @@ type ReadSizeProvider interface {
RemainingBytes() (num_bytes uint64) RemainingBytes() (num_bytes uint64)
} }
// Encapsulates the I/O layer // Encapsulates the I/O layer
type TTransport interface { type TTransport interface {
io.ReadWriteCloser io.ReadWriteCloser
@ -52,7 +51,6 @@ type stringWriter interface {
WriteString(s string) (n int, err error) WriteString(s string) (n int, err error)
} }
// This is "enchanced" transport with extra capabilities. You need to use one of these // This is "enchanced" transport with extra capabilities. You need to use one of these
// to construct protocol. // to construct protocol.
// Notably, TSocket does not implement this interface, and it is always a mistake to use // Notably, TSocket does not implement this interface, and it is always a mistake to use
@ -65,4 +63,3 @@ type TRichTransport interface {
Flusher Flusher
ReadSizeProvider ReadSizeProvider
} }

1
zk.go
View file

@ -36,7 +36,6 @@ type ServiceInstance struct {
Status string `json:"status"` Status string `json:"status"`
} }
// Retrieves current Aurora leader from ZK. // Retrieves current Aurora leader from ZK.
func LeaderFromZK(cluster Cluster) (string, error) { func LeaderFromZK(cluster Cluster) (string, error) {