尋常でないもふもふ

a software engineer blog

2016-10-01から1ヶ月間の記事一覧

ghqでGitHubのリポジトリ管理する

概要 ソースコードは Go 言語のエコシステム(?) $GOPATH 配下での一元管理と決められたディレクトリ構造をそのまま活用することにした。そのために便利な ghq を導入する。 GitHub - motemen/ghq: Remote repository management made easy ちなみにプログラ…

プライベートリポジトリをgo getする方法

自分のプライベートリポジトリをgo getすると以下のようなエラーが発生する。 $ go get github.com/jnst/my-private-repo # cd .; git clone https://github.com/jnst/my-private-repo /Users/jnst/go/src/github.com/jnst/my-private-repo Cloning into '/U…

Rubyでarray.each_index.injectしたときの括弧は配列展開

こういうやつ animals = { a1: { name: '犬', type: '哺乳類' }, a2: { name: '猫', type: '哺乳類' }, a3: { name: '蜥蜴', type: '爬虫類' } } mammals = animals.reduce([]) do |arr, (id, animal)| # <- ここの丸括弧 (animal[:type] == '哺乳類') ? (ar…