Skip to content

Instantly share code, notes, and snippets.

View tonyyang-svail's full-sized avatar

Yang Yang(Tony) tonyyang-svail

View GitHub Profile
import (
"encoding/json"
"fmt"
)
func JSONPrint(i interface{}) {
b, err := json.MarshalIndent(i, "", " ")
if err != nil {
fmt.Println("error:", err)
}

title

@tonyyang-svail

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
//
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);
syntax = "proto3";
import "google/protobuf/any.proto";
package server;
service SQLFlow {
rpc Query (Request) returns (stream RowSet);
rpc Execute (Request) returns (stream Messages);
}
syntax = "proto3";
import "google/protobuf/any.proto";
package server;
service SQLFlow {
rpc Query (Request) returns (stream RowSet);
rpc Execute (Request) returns (stream Messages);
}
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