2020-12-12から1日間の記事一覧

同じシグネチャを持つ異なる関数たちのreflect.Typeのidentityについて

シグネチャが同じ関数のreflect.Typeが一致することに気づかずハマったりしていた1。 package main import ( "fmt" "reflect" ) type Foo string type Bar string type Alias = string func Hello(string) string { return "" } func Byebye(string) string …

reflect-openapiにswagger-uiを組み込んだ

github.com この記事の続き。いろいろ変更を加えてswagger-uiを組み込んだ。 goで作られた既存のweb APIに後付けでopenAPI docを付けたかった これまでのreflect-openapi 以下のような "Hello " と返すだけの関数を公開する。 type HelloInput struct{ Name …