What do you want to save?
Add Code snippet
New code examples
-
Other 2022-03-10 18:10:03
protocol buffers stream golang
package main import ( "context" "io" "log" pb "github.com/pramonow/go-grpc-server-streaming-example/src/proto" "google.golang.org/grpc" ) func main() { // dial server conn, err := grpc.Dial(&quo... Add solution -
Go 2022-03-02 10:40:01
bcrypt golang
package util import ( "github.com/sirupsen/logrus" "golang.org/x/crypto/bcrypt" ) func HashPassword(password string) string { pw := []byte(password) result, err := bcrypt.GenerateFromPassword(pw, bcrypt.DefaultCost) if err != ni... Add solution -
Other 2022-01-23 02:50:38
copy docker image from one machine to another
FROM golang:1.7.3 AS builder WORKDIR /go/src/github.com/alexellis/href-counter/ RUN go get -d -v golang.org/x/net/html COPY app.go . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app . FROM alpine:latest RUN apk --no-cache add ca-... Add solution -
TypeScript 2021-11-19 15:10:17
golang ssh server and lets encrypt auto
package main import ( "crypto/tls" "fmt" "net/http" "golang.org/x/crypto/acme/autocert" ) func main() { mux := http.NewServeMux() mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {... Add solution -
Other 2021-10-21 23:20:07
go language while loop
package main import "fmt" func main(){ //only one type of look in golang. A for loop. to make a while loop simple //emit all statments but the bools var x int = 10 for x > 0{ fmt.Println(x)//this will print all numbers fro... Add solution -
Go 2021-09-30 06:56:03
go online compiler
Check this compiler: https://play.golang.org/ Add solution