This file contains hidden or 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 ( | |
| "context" | |
| "strconv" | |
| "strings" | |
| apiapp "k8s.io/kubernetes/cmd/kube-apiserver/app" | |
| ) |
This file contains hidden or 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 | |
| // logger := slog.New(DefaultOptions().NewHandler()) | |
| // a 'context' attribute will be promote to wasilog 'context' field | |
| // logger = logger.With("context", "Get") | |
| // | |
| // logger.Info("Hello world") | |
| // logger.Warn("Hello world 1", "key", "value") | |
| // logger.Info("Hello world 2", slog.String("key", "value")) | |
| // logger.Info("Hello world 3", slog.Any("key", 123), slog.String("context", "SomethingElse")) |
This file contains hidden or 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 secrets | |
| import ( | |
| "errors" | |
| "fmt" | |
| jwt "github.com/golang-jwt/jwt/v5" | |
| "github.com/nats-io/nkeys" | |
| ) |
This file contains hidden or 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 | |
| // example | |
| // go run ./main.go <gcp-project-name> <pubsub-subscription-name> | jq -r .payload.source.table | |
| import ( | |
| "context" | |
| "fmt" | |
| "os" | |
| "os/signal" |
This file contains hidden or 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
| name: "QA commands" | |
| on: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| if: github.event.issue.pull_request && startsWith(github.event.comment.body, '/qa') |
This file contains hidden or 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" | |
| corev1 "k8s.io/api/core/v1" | |
| "sigs.k8s.io/controller-runtime/pkg/client/config" | |
| "sigs.k8s.io/controller-runtime/pkg/controller" | |
| "sigs.k8s.io/controller-runtime/pkg/handler" | |
| "sigs.k8s.io/controller-runtime/pkg/manager" |
This file contains hidden or 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" | |
| "sync/atomic" | |
| "unsafe" | |
| ) | |
| type thing struct { | |
| name string |
This file contains hidden or 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 ( | |
| "encoding/json" | |
| "fmt" | |
| ) | |
| type Thing1 struct { | |
| String string `json:"meow"` | |
| } |
This file contains hidden or 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
| " adapted from https://github.com/fatih/dotfiles/blob/master/vimrc | |
| " create a go doc comment based on the word under the cursor | |
| function! s:create_go_doc_comment() | |
| norm "zyiw | |
| execute ":norm O// " | |
| norm "zp | |
| execute ":norm A ..." | |
| endfunction | |
| nnoremap <leader>ui :<C-u>call <SID>create_go_doc_comment()<CR> |
This file contains hidden or 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 ( | |
| "context" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "log" | |
| "net/http" |
NewerOlder