Skip to content

Commit

Permalink
Fix long line warnings. (#3520)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr authored Jun 6, 2019
1 parent ca4604d commit 2a4fabd
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
3 changes: 0 additions & 3 deletions contrib/integration/bank/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ func (s *State) runTotal(dg *dgo.Dgraph) error {
}

func (s *State) findAccount(txn *dgo.Txn, key int) (Account, error) {
// query := fmt.Sprintf(`{ q(func: eq(key, %d)) @filter(eq(typ, "ba")) { key, uid, bal, typ }}`, key)
query := fmt.Sprintf(`{ q(func: eq(key, %d)) { key, uid, bal, typ }}`, key)
// log.Printf("findACcount: %s\n", query)
resp, err := txn.Query(context.Background(), query)
if err != nil {
return Account{}, err
Expand All @@ -163,7 +161,6 @@ func (s *State) findAccount(txn *dgo.Txn, key int) (Account, error) {
}

func (s *State) runTransaction(dg *dgo.Dgraph, buf *bytes.Buffer) error {
// w := os.Stdout
w := bufio.NewWriter(buf)
fmt.Fprintf(w, "==>\n")
defer func() {
Expand Down
3 changes: 2 additions & 1 deletion contrib/integration/mutates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ func TestQuery3Quads(ctx context.Context, c *dgo.Dgraph) {
log.Fatalf("Error while running query: %v\n", err)
}
fmt.Printf("Response JSON: %q\n", resp.Json)
x.AssertTrue(bytes.Equal(resp.Json, []byte("{\"me\":[{\"name\":\"ok 200\"},{\"name\":\"ok 300\"},{\"name\":\"ok 400\"}]}")))
x.AssertTrue(bytes.Equal(resp.Json, []byte(
"{\"me\":[{\"name\":\"ok 200\"},{\"name\":\"ok 300\"},{\"name\":\"ok 400\"}]}")))
x.AssertTrue(resp.Txn.StartTs > 0)
x.Check(txn.Commit(ctx))
}
4 changes: 3 additions & 1 deletion dgraph/cmd/zero/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ func (t *Telemetry) post() error {
return err
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "D0398E8C83BB30F67C519FDA6175975F680921890C35B36C34BE109544597497CA758881BD7D56CC2355A2F36B4560102CBC3279AC7B27E5391372C36A31167EB0D06BF3764894AD20A0554BAFF14C292A40BC252BB9FF008736A0FD1D44E085")
req.Header.Set("Authorization", "D0398E8C83BB30F67C519FDA6175975F680921890C35B36C34BE1095445"+
"97497CA758881BD7D56CC2355A2F36B4560102CBC3279AC7B27E5391372C36A31167EB0D06BF3764894AD20"+
"A0554BAFF14C292A40BC252BB9FF008736A0FD1D44E085")

client := &http.Client{}
resp, err := client.Do(req)
Expand Down
4 changes: 3 additions & 1 deletion gql/mutation.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,9 @@ func toUid(subject string, newToUid map[string]uint64) (uid uint64, err error) {

var emptyEdge pb.DirectedEdge

func (nq NQuad) createEdge(subjectUid uint64, newToUid map[string]uint64) (*pb.DirectedEdge, error) {
func (nq NQuad) createEdge(subjectUid uint64, newToUid map[string]uint64) (
*pb.DirectedEdge, error) {

var err error
var objectUid uint64

Expand Down
4 changes: 3 additions & 1 deletion worker/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ func getSchemaOverNetwork(ctx context.Context, gid uint32, s *pb.SchemaRequest,

// GetSchemaOverNetwork checks which group should be serving the schema
// according to fingerprint of the predicate and sends it to that instance.
func GetSchemaOverNetwork(ctx context.Context, schema *pb.SchemaRequest) ([]*api.SchemaNode, error) {
func GetSchemaOverNetwork(ctx context.Context, schema *pb.SchemaRequest) (
[]*api.SchemaNode, error) {

ctx, span := otrace.StartSpan(ctx, "worker.GetSchemaOverNetwork")
defer span.End()

Expand Down
3 changes: 2 additions & 1 deletion x/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func Init() {
func BuildDetails() string {
licenseInfo := `Licensed under the Apache Public License 2.0`
if !strings.HasSuffix(dgraphVersion, "-oss") {
licenseInfo = `Licensed variously under the Apache Public License 2.0 and Dgraph Community License`
licenseInfo = "Licensed variously under the Apache Public License 2.0 and Dgraph " +
"Community License"
}
return fmt.Sprintf(`
Dgraph version : %v
Expand Down
3 changes: 2 additions & 1 deletion x/tls_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ func setupClientAuth(authType string) (tls.ClientAuthType, error) {
if v, has := auth[strings.ToUpper(authType)]; has {
return v, nil
}
return tls.NoClientCert, fmt.Errorf("Invalid client auth. Valid values [REQUEST, REQUIREANY, VERIFYIFGIVEN, REQUIREANDVERIFY]")
return tls.NoClientCert, fmt.Errorf("Invalid client auth. Valid values " +
"[REQUEST, REQUIREANY, VERIFYIFGIVEN, REQUIREANDVERIFY]")
}

return tls.NoClientCert, nil
Expand Down
3 changes: 2 additions & 1 deletion x/x.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const (
ErrorInvalidRequest = "ErrorInvalidRequest"
Error = "Error"
ErrorNoData = "ErrorNoData"
ValidHostnameRegex = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$"
ValidHostnameRegex = "^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.)*([A-Za-z0-9]" +
"|[A-Za-z0-9][A-Za-z0-9\\-]*[A-Za-z0-9])$"
// When changing this value also remember to change in in client/client.go:DeleteEdges.
Star = "_STAR_ALL"

Expand Down

0 comments on commit 2a4fabd

Please sign in to comment.