tkuchikiの日記

新ブログ https://blog.tkuchiki.net

1.4.2

Golang で filepath.Abs に ~(ホームディレクトリ) を指定した時にカレントワーキングディレクトリが先頭についてしまう

検証した環境は以下のとおりです。 $ go version go version go1.4.2 linux/amd64 $ whoami tkuchiki $ touch ~/testfile $ cd /tmp した状態で、 // main.go package main import ( "fmt" "path/filepath" ) func main() { abspath, _ := filepath.Abs("~/t…