Skip to content

Instantly share code, notes, and snippets.

@yuucu
yuucu / main.go
Last active October 26, 2023 17:47
generate OpenAPI by cuelang
package main
import (
"bytes"
"encoding/json"
"fmt"
"cuelang.org/go/cue/cuecontext"
"cuelang.org/go/cue/load"
"cuelang.org/go/encoding/openapi"
@yuucu
yuucu / main.go
Created October 18, 2023 00:45
interface活用例
package main
func main() {
fileManager := fileManager{
storage: &FileStorage{},
}
fileManager.Save("test.txt", "テストデータ")
}
@yuucu
yuucu / echo_pprof.go
Created September 18, 2023 13:25
goのechoでpprofするサンプル
package main
import (
"net/http"
"github.com/labstack/echo-contrib/pprof"
"github.com/labstack/echo/v4"
"golang.org/x/crypto/bcrypt"
)
@yuucu
yuucu / exception.go
Last active August 31, 2023 15:14
exception example
package exception
import (
"fmt"
"runtime"
)
type errorcode int
const (
@yuucu
yuucu / vimium.vim
Last active July 8, 2022 18:23
vimium.vim
# Insert your preferred key mappings here.
unmapAll
map j scrollDown
map k scrollUp
map gg scrollToTop
map G scrollToBottom
map <c-d> scrollPageDown
map <c-u> scrollPageUp
@yuucu
yuucu / Dockerfile
Last active June 21, 2022 18:18
opensearch docker sample
FROM opensearchproject/opensearch:1.2.0
RUN /usr/share/opensearch/bin/opensearch-plugin install analysis-kuromoji
RUN /usr/share/opensearch/bin/opensearch-plugin install analysis-icu
@yuucu
yuucu / main.go
Created February 11, 2022 17:28
OpenAPIによるスキーマ駆動開発 with golang
package main
import (
"fmt"
"sample/openapi"
"github.com/labstack/echo/v4"
)
type server struct{}