@tonyyang-svail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func JSONPrint(i interface{}) { | |
b, err := json.MarshalIndent(i, "", " ") | |
if err != nil { | |
fmt.Println("error:", err) | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
import "google/protobuf/any.proto"; | |
package server; | |
// SQL statements like `SELECT ...`, `DESCRIBE ...` returns a rowset. | |
// The rowset might be big. In such cases, Query returns a stream | |
// of RunResponse | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
import "google/protobuf/any.proto"; | |
package server; | |
service SQLFlow { | |
rpc File (Request) returns (Job); | |
rpc ReadRow(Job) returns (stream Row); | |
rpc ReadLog(Job) returns (stream Log); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
import "google/protobuf/any.proto"; | |
package server; | |
service SQLFlow { | |
rpc Query (Request) returns (stream RowSet); | |
rpc Execute (Request) returns (stream Messages); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
import "google/protobuf/any.proto"; | |
package server; | |
service SQLFlow { | |
rpc Query (Request) returns (stream RowSet); | |
rpc Execute (Request) returns (stream Messages); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/pkg/errors" | |
) | |
func bar() error { | |
return errors.Wrap(fmt.Errorf("barError"), "bar") |
:=
is similar to var =
Setting GOPATH
export GOPATH=~/go
export PATH=$PATH:$GOPATH/bin
:=
slice is shallow copy
NewerOlder