LoginSignup
2
1

More than 3 years have passed since last update.

Terminal上でGo Playgroundの共有リンクをシュット作る

Last updated at Posted at 2019-06-19

初めに

さらっと書いたGoソースを共有するとき、Go Playgroundのshare機能が便利です。
本稿では、Terminal上のGoソースの共有リンクを簡単に取得する方法を紹介します。
小技程度です。。正直あまり使わない。。

共有コマンド

ファイル名のところに共有したいGoソースのパスを指定してください。

bashの場合

echo "https://play.golang.org/p/"$(curl -sSX POST -H "Content-Type: application/json" --data-binary @ファイル名 https://play.golang.org/share)

fishの場合

echo "https://play.golang.org/p/"(curl -sSX POST -H "Content-Type: application/json" --data-binary @ファイル名 https://play.golang.org/share)

よく使うならpetに登録しよう!

コマンドを覚えるのは面倒なのでknqyf263/petを使って登録しておきましょう!
最後に私のsnippet.tomlを晒しておきます。

参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1