Code Monkey home page Code Monkey logo

golang-gin-example's Introduction

golang-gin-example

Install Go

Goをインストールする。

$ brew update
$ brew install go --cross-compile-all

launchctlに登録する。

# /etc/launchd.conf
setenv GOROOT /usr/local/Cellar/go/1.3.1/libexec
setenv GOPATH $HOME/.go
$ launchctl < /etc/launchd.conf

Run golang-gin-example

パッケージマネージャにgoopを使用しているので、インストールする。

$ go get github.com/nitrous-io/goop

対象のリポジトリをクローンする。

$ git clone [email protected]:osamingo/golang-gin-example.git

ディレクトリを移動して、依存関係を解決する。
goopコマンドが見つからない場合は、$GOPATH/bin/goopとかに存在するのでPATHを通す。

$ cd golang-gin-example
$ goop install

go runで動かす。

$ goop go run src/main.go

起動後、http://localhost:8080/pingに繋がるか確認できればOKです。

Install IntelliJ IDEA & Golang plugin

IntelliJ IDEA

DL site: IntelliJ IDEA - The Best Java and Polyglot IDE

上記のサイトから、通常通りインストールする。

Install Golang plugin

EAP DL site: @dlsniper's dropbox (@via/ go-lang-plugin-org/go-lang-idea-plugin)

最新版のプラグインを使用したいので、作者のDropboxからEAPのjarをDLする。

install-plugin-from-jar

上記のハイライトしているボタンを押下してインストールする。

Start IntelliJ IDEA

コマンドラインから起動しないと、何故かGOROOTを見てくれないので、openコマンドで起動する。

$ open /Applications/IntelliJ\ IDEA\ 13\ CE.app

起動後、Import Project...からプロジェクトをインポートする。

import-project-one

import-project-two

import-project-three

インポート後、Shift + Command + Aで、Find Actionを起動させる。

edit-configurations

.vendorGOPATHを通す。

edit-configurations-detail

main.goを右クリックし、起動させる。

run-main

起動後、http://localhost:8080/pingに繋がるか確認できればOKです。

golang-gin-example's People

Contributors

osamingo avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.