You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
golang と言えば非同期に特化した言語ですが、慣れない内は簡単な非同期しか使えません。しかし sync パッケージを知る事でもっとカジュアルに、かつ確実な非同期処理を行う事が出来る様になります。 今日はそんな sync パッケージについて説明してみたいと思います。 sync.Mutex ご存じ sync.Mutex です。皆さんが一番使う排他制御だと思います。 package main import ( "fmt" "runtime" "sync" "time" ) func parallel(wg *sync.WaitGroup) { fmt.Println("博") time.Sleep(100 * time.Millisecond) fmt.Println("多") time.Sleep(100 * time.Millisecond) fmt.Println("の") time.
Martini. Web framework for Go 31 May 2014 / Go Conference 2014 spring / Keiji Yoshida About me Web developer Started using Go half a year ago Joined Martini Contrib this month Abstract About Martini - Web framework for Go Developed by Jeremy Saenz @codegangsta v0.1 in Dec. 2013 / RC1 in Apr. 2014 / v1.0 in May 2014 Inspired by Express and Sinatra Hello world! package main import "github.com/go-mar
pt(the_platinum_searcher) を高速化するために Goroutines まわりで試したことを発表しました。 http://connpass.com/event/6370/
SoundCloudが2年半ほどGo言語を利用したプロダクトを本番で運用した知見をGopherConで発表していた(“Go: Best Practices for Production Environments”).その中で“CodeReviewCommentsというGoogleでのGo言語のコードレビューにおいてよくあるコメントをまとめたサイトが紹介されていた. 最近Go言語を書くようになり,使えそうなのでざっと抄訳してみた.“リーダブルコード”的な視点も含まれており,Go以外の言語でも使えそう. gofmtでコードの整形をすること コメントは文章で書くこと.godocがいい感じに抜き出してくれる.対象となる関数(変数)名で初めて,ピリオドで終わること // A Request represents a request to run a command. type Request str
EngineeringHijacking Amazon EventBridge for launching Cross-A...Securing the invisible paths: How cross-account event flows can become security ... Data ScienceRevamping Data Science InterviewsInterviews are not just about improving hiring outcomes - they are about strengt... EngineeringRoBERTa Model for Merchant Categorization at Squar...Harnessing Large Language Models to Deliver Accurate Busine
複数プラットフォームにGoアプリケーションを配布する tcnksm/jj 最近試しにGo言語でCLIアプリケーションを作成した.joelthelion/autojumpをシンプルにしただけのツールで,ディレクトリを保存して,どこからでもその保存したディレクトリへの移動を可能にする. Goの環境さえあれば,このようなGo言語のアプリケーションの配布はとても簡単で,インストールは以下のようにするだけでよい. $ go get github.com/tcnksm/jj_ これだけではなく,Goはクロスコンパイルが簡単で,様々なプラットフォーム向けにバイナリを生成することができる.つまり,Goがインストールされていない環境に対しても簡単にツールを配布することができる. Packerなどの最近のHashicorp制のツールは,Go言語で書かれており,OSX,Linux,Windows,FreeBSD
Introduction This is the reference manual for the Go programming language. The pre-Go1.18 version, without generics, can be found here. For more information and other documents, see go.dev. Go is a general-purpose language designed with systems programming in mind. It is strongly typed and garbage-collected and has explicit support for concurrent programming. Programs are constructed from packages
Introduction This document demonstrates the development of a simple Go package inside a module and introduces the go tool, the standard way to fetch, build, and install Go modules, packages, and commands. Code organization Go programs are organized into packages. A package is a collection of source files in the same directory that are compiled together. Functions, types, variables, and constants d
追記 この記事は元々 Go のイディオムとして、いわゆるジェネレータの実装がどうできるのかを軽い気持ちで書いただけで、速いから「Closure を使いましょう」などと一言も言ってなかったのですが、一方が channel であったため原子性についての言及がいくつかありました。 自分としては、ローカルのちょっとしたツール(shell の代わりくらい) の中で使ってただけなので、並行性には言及するつもりがそもそも無かったのですが、自分もそうした前提を書いていなかったのにも原因があります。 例えばこの記事が「グローバルシーケンス」の実装例として参考にされ Web アプリにでもコピペされて、バグの原因になったりでもしたらマズイので大幅に追記します。 (正直ロックを使った排他制御はあまり得意では無いですが。。) Intro 無限に連番を生成するロジックをジェネレータとして組むときに、 Go の場合は二
intro 先日の Go のカンファレンス GoCon で、 Go の並行処理周りについて発表させて頂きました。 Go Conference 2013 spring - connpass 具体的には Goroutine や Channel の話ですが、これらの機能は結構面白くて、いじって遊んでるだけでもわくわくします。 Go の並行処理は、設計方針がわりと特殊だと思うのですが、設計がシンプルなので分かるとそこまで難しくはないです。 (使いこなすのは、経験が必要そうですが) 今回話すにあたって色々調べましたが、発表時間の都合上省いたものもあるし、質疑応答で聞かれて応えられなかったこともあるので、 ここでまとめて置こうと思います。 発表資料 今回の発表資料はこちらです。 このブログの内容は、これをベースにします。 http://jxck.node-ninja.com/slides/gocon-
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く