LoginSignup
1
2

More than 5 years have passed since last update.

CentOS と VSCode で Golang リモート開発環境

Posted at

Install Golang in CentOS server

  1. wget -O go.tgz https://dl.google.com/go/go*.*.*.linux-amd64.tar.gz

    1. sudo tar -C /usr/local -xzf go.tgz
    2. rm go.tgz
  2. ls .bash_profile

    • vim .bash_profile
      1. export PATH=$PATH:/usr/local/go/bin:/$HOME/go/bin
      2. export GOPATH=/$HOME/go
    • source .bash_profile
    • test: go version
  3. mkdir -p $GOPATH/src/

Install rmate in CentOS server

  • sudo wget -O /usr/local/bin/rmate https://raw.github.com/aurora/rmate/master/rmate
  • sudo chmod a+x /usr/local/bin/rmate

Remote Edit in Local machine

  • Install VSCode
  • Enable "Remote VSCode" in Extensions
  • TO Use:
    1. cmd+P: >remote start server
    2. ssh -R 52698:localhost:52698 hostname(centos server)
    3. rmate "filename"
    4. edit, save
    5. when u finished: cmd+P: >remote stop server
1
2
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
1
2