CFMT adalah alat untuk membungkus komentar dengan panjang tertentu ke baris baru.
go get -u github.com/alexkohler/cfmt
Catatan : CFMT membutuhkan gofmt.
Mirip dengan alat anaylsis statis go lainnya (seperti Golint, Go Vet), CFMT dapat dipanggil dengan satu atau lebih nama file, direktori, atau paket yang disebutkan oleh jalur impornya. CFMT juga mendukung ... wildcard.
cfmt [flags] files/directories/packages
cfmt hanya akan mencetak perubahan yang akan dilakukannya, tetapi tidak akan memodifikasi file input. cfmt akan membungkus ke jalur baru atau bergabung dengan jalur yang ada. Lihat yang berikut sebelum/setelah menjalankan cfmt -m=100 :
Sebelum
// I am a long comment that is over 100 characters long. I should probably wrap to a new line.Setelah
// I am a long comment that is over 100 characters long. I should probably wrap
// to a new line.Sebelum
// I am a long comment that is over 100 characters long. I should probably wrap below to the
// rest of the comment.Setelah
// I am a long comment that is over 100 characters long. I should probably wrap
// below to the rest of the comment.Sebelum
//I am a long comment that starts without a space and is over 100 characters long. When I wrap, I should still start without a spaceSetelah
//I am a long comment that starts without a space and is over 100 characters
//long. When I wrap, I should still start without a space cfmt mengabaikan komentar blok ( /* */ ) dan komentar "dikelompokkan" dengan panjang 10 (yaitu 10+ baris berturut -turut dimulai dengan // ).
Tarik Permintaan Selamat Datang!
Jika Anda menikmati CFMT, lihatlah alat anaylsis statis saya yang lain!