Skip to content

Instantly share code, notes, and snippets.

View dimiro1's full-sized avatar

Claudemiro A F Neto dimiro1

  • Berlin, Germany
View GitHub Profile
// running:
// $ AWS_KMS_KEY_ID=kms_id AWS_ACCESS_KEY=aws_access_key AWS_SECRET_KEY=aws_secret_key go run gokms.go
package main
import (
"database/sql"
"database/sql/driver"
"encoding/base64"
package main
import (
"log"
"time"
)
// User is a user in the application.
type User struct {
ID int
@dimiro1
dimiro1 / main.go
Created July 20, 2023 19:56
Rich value types in Golang
package main
import (
"database/sql"
"database/sql/driver"
"errors"
"fmt"
"log"
"strconv"
"strings"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Page Title</title>
</head>
<body>
<header>This is the header, this is the same on all pages</header>
{% block content %}This content we can override on child templates{% endblock %}
package main
import (
"fmt"
"net/http"
"time"
)
type Params interface {
String(r *http.Request, name string) string
package main
import (
"context"
"github.com/garyburd/redigo/redis"
)
//TranslationsPipe interface {
//Pipe(ctx context.Context, source dbTranslations.TranslationSource, dest cacheTranslations.TranslationsManager, ids []uint64, defaultNames map[uint64]string) error
//}
package main
import (
"errors"
"fmt"
)
// Person is a demo struct
type Person struct {
Name string
package main
import (
"fmt"
"math/rand"
"net/http"
"github.com/gin-gonic/gin/json"
)
package main
import (
"fmt"
"strings"
)
type Clause interface {
By() string
}