Skip to content

Instantly share code, notes, and snippets.

@EvgenyOrekhov
EvgenyOrekhov / A simple Docker and Docker Compose install script for Ubuntu.md
Last active February 8, 2025 23:28
A simple Docker and Docker Compose install script for Ubuntu

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

@enricofoltran
enricofoltran / main.go
Last active April 6, 2025 09:48
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@thiagozs
thiagozs / gomock.md
Last active May 11, 2025 14:44
Tutorial gomock

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.

@i-mighty
i-mighty / cloudSettings
Last active June 12, 2022 05:23
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-07-28T18:41:31.661Z","extensionVersion":"v3.4.3"}
// HTTPError implements ClientError interface.
type HTTPError struct {
Cause error `json:"-"`
Detail string `json:"detail"`
Status int `json:"-"`
}
func (e *HTTPError) Error() string {
if e.Cause == nil {
return e.Detail
@miguelmota
miguelmota / example.proto
Last active January 3, 2025 00:11
Golang protobuf marshal and unmarshal example
syntax = "proto3";
message Message {
bytes text = 1;
}
@byyam
byyam / gin-json-schema.go
Last active September 6, 2021 11:28
gin json schema
package main
import (
"fmt"
"bytes"
"strings"
"io/ioutil"
"net/http"
"github.com/gin-gonic/gin"
"github.com/xeipuuv/gojsonschema"
)
@joeke80215
joeke80215 / test_http.go
Created November 11, 2019 08:13
golang gin httptest example
package service
import (
"fmt"
"log"
"net/http"
"net/http/httptest"
"strings"
"testing"

A simple Docker and Docker Compose install script for Ubuntu

Usage

  1. sh install-docker.sh
  2. log out
  3. log back in

Links

package oauth2
import (
"context"
"encoding/json"
"errors"
"fmt"
"inawo-services-api/pkg/env"
"os"
"time"