切り替える理由 自社の主力製品で利用している技術(WebRTC / WebTransport)がブラウザベースのため TypeScript を利用する Go を採用したのは sqlc が使いたかったという理由 sqlc-gen-typescript が出てきたのでもう Go を使う理由がなくなった 自社サービスチーム全員が Go にまったく興味が無い sqlc 自体は便利 そもそも自社に Go への興味がある人がいない 自社サービスの規模ではボトルネックになるのはデータベースであって言語ではない もしアプリでスケールが必要なときは Rust や Erlang/OTP に切り替えれば良い コネクションプールは PgBouncer を利用すればいい TypeScript からは 1 コネクション 1 接続で問題無い どうせフロントエンドでは TypeScript を書く 自社では React
Go言語で書かれたorderedmapというサードパーティパッケージがあります。 github.com Goのmapには順序がなく、JSONをデコードすると順序が失われ、それをエンコードするとオブジェクトのキーの順序にソートされます。 これに困る人はそこそこいるようで、順序を保持するmapはいくつか実装されてきました。 その中の一つが、orderedmapというパッケージです。 シンプルなインターフェイスが気に入っています。 orderedmapパッケージの利用例 package main import ( "encoding/json" "fmt" "log" "github.com/iancoleman/orderedmap" ) func main() { src := `{ "z": 1, "x": 2, "y": 3 }` fmt.Println("# map[string]in
synchro と呼ばれる Go でもタイムゾーンを含めて型比較できるようになるライブラリを開発し始めました。スターください。 こんな感じで使えます。 package main import ( "fmt" "time" "github.com/Code-Hex/synchro" "github.com/Code-Hex/synchro/tz" ) func main() { utcNow := synchro.Now[tz.UTC]() jstNow := synchro.Now[tz.AsiaTokyo]() fmt.Println(utcNow) fmt.Println(jstNow) // Output: // 2023-09-02 14:00:00 +0000 UTC // 2023-09-02 23:00:00 +0900 JST fmt.Println("------") d
This is a discussion intended to lead to a formal proposal. This was written with input from @mvdan, @johanbrandhorst, @rogpeppe, @chrishines, @rsc. Background The widely-used "encoding/json" package is over a decade old and has served the Go community well. Over time, we have learned much about what works well and what does not. Its ability to marshal from and unmarshal into native Go types, the
Go 1.22のトピックとしては以下のようなものがあります。だいぶ安定版になってきたからか、言語もライブラリもこつぶなものが多くなってきたかな、という印象です。 ループ変数の挙動の変化 ツール系 GO111MODULE=offオプションの廃止 トレースツールのUI改善 net/httpのServeMuxでパス変数が扱えるように go vet強化 コンパイラでGCが1-3%高速化。PGOで2-14%改善 リンカーの生成するバイナリがよりデバッガフレンドリーに ライブラリ math/rand/v2追加 database/sql.NUllの追加 net/httpのルーターがパスパラメータをとれるように その他 個人的に注目しているHTTP/3やQUICへの対応は、準標準ライブラリのgolang.org/x/net/internal/quicの中で進行中。将来的にはinternalが外れたgola
David Chase and Russ Cox 19 September 2023 Go 1.21 includes a preview of a change to for loop scoping that we plan to ship in Go 1.22, removing one of the most common Go mistakes. The Problem If you’ve written any amount of Go code, you’ve probably made the mistake of keeping a reference to a loop variable past the end of its iteration, at which point it takes on a new value that you didn’t want.
This UI and backend are implemented with only 150 lines of code, including the HTML! The full example code for this tutorial is available in the babyapi GitHub repository if you're eager to get into it. In my recent article, The Easiest Way to Create a REST API With Go, I demonstrated how babyapi can jumpstart REST API creation. This time, I will walk you through some additional babyapi features a
We need remote ips Yesterday I was tasked with figuring out how to properly ascertain remote web client IP Addresses in our golang web services. This sounds like a stupidly easy exercise, and golang MUST have a fancy utility for this right? Nope. Turns out getting the remote IP Address is really hard. The naïve approach Within the golang net.Request structure there is a RemoteAddr attribute, which
この記事は Go Advent Calendar 2023 7 日目の記事です。 こんにちは。ARIGATOBANK バックエンドエンジニアの富樫です。 私たちのチームでは、バックエンドシステムのすべてを Go 言語で構築しています。これまでロギングライブラリとして主に zap を利用してきましたが、最近 Go 1.21 で追加された log/slog を本番環境の一部サービスで利用し始めました。 この記事では、log/slog を開発や本番環境へ投入するにあたってカスタマイズした実装の詳細について共有します。 log/slog とはGo 1.21 で標準ライブラリに加わった log/slog は、構造化ロギングをサポートするログパッケージです。 slog package — log/slog — Go Packages 基本的な使い方はこんな感じです。 package main impo
面白法人カヤック技術部の谷脇です。私は元気です。 この記事は面白法人グループ Advent Calendar 2023の5日目のエントリーです。 というわけでこの記事では、現環境(私が取り組んでいる業務のこと)ベストの管理画面の技術選択について考えたことを書き連ねていきます。 前提知識 管理画面の定義 ここで読者と私の目線を合わせるため、この記事上での管理画面の定義をしておきます。 管理画面はサービスの運営上必要な操作やデータの閲覧をまとめたWebアプリケーションです。また、このWebアプリケーションは一般ユーザーには開放されておらず、サービス運営者側のみ閲覧と操作が可能となっている、とします。 管理画面を作る動機 ここではTonamelの管理画面について、考えて導入したことを書きます。 tonamel.com Tonamelはゲーム大会やイベントを開催するためのプラットフォームです。We
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く