SlideShare a Scribd company logo
Windows에서
Go+Eclipse개발환경 구축
GDG Korea Golang
김재훈
jaehoon@gmail.com
2013.4.20
목차
• 개요
• 설치
• 프로젝트
• 크로스 컴파일
개요
1. 목적
- Windows 환경에서 Go 언어를 이용하기 위한 개발 환경을 구축
( Eclipse + GoClipse +EGit )
2. 대상
- Go 언어를 처음 접해보는 사용자
- Eclipse를 처음 접해보는 사용자
설치 - 다운로드 및 설치
1. Go
( https://code.google.com/p/go/downloads/list?q=OpSys-Windows+Type%3DInstaller )
2. Eclipse ( ver 3.7 이상)
( http://www.eclipse.org/downloads/ )
3. GoClipse ( ver 0.7.6 )
( https://code.google.com/p/goclipse/ )
( http://goclipse.googlecode.com/svn/trunk/goclipse-update-site/ )
4. EGit
( http://www.eclipse.org/egit/ )
( http://download.eclipse.org/egit/updates/ )
설치 - GoClipse
1. Help -> Install New
Software...
2. Work with 항목
( http://goclipse.googlecode.com/svn/trunk/goclipse-update-site )
3. Add
4. Add Repository에서 'OK' 선택
설치 - GoClipse
1. GoClipse -> Next -> Next
2. 라이센스동의 -> Finish
3. Eclipse 재시작
설치 - EGit
1. Help -> Install New Software...
2. Work with
(http://download.eclipse.org/egit/updates/)
3. Add
4. Add Repository 에서 'OK' 선택
설치 - EGit
1. Eclipse EGit 선택 ->
Next -> Next
2. 라이센스 동의 -> Finish
3. Eclipse 재시작
설치 - 환경설정(기본)
1. Window -> Preferences
2. GOROOT에 Go가 설치된
디렉토리를 선택
3. Apply
* GOROOT아래에 bin디렉토리가 존재하면, Go Tools 항목은 자동으
로 채워짐
설치 - 환경설정(GDB)
1. gdb.exe
( http://www.equation.com/servlet/equation.cmd?fa=gdb )
( http://www.drangon.org/mingw/ )
바이너리 다운로드
2. GDB Path에 경로 추가
설치 - 환경설정(GDB)
1. Run->
Debug Configurations...
2. Go Application
3. 항목
Name : Debug 타이틀
Project : 디버깅을 진행 할 프로젝트
Main source file : main 메소드가 있는 파일
Arguments : 디버깅 옵션
Build configurations : DEBUG
4. Debug
설치 - 환경설정(GoCode)
2. gocode.exe (자동 완성)
( https://code.google.com/p/goclipse/downloads/list )
( https://github.com/nsf/gocode )
소스를 직접 빌드
3. GOROOTbin 에 복사
설치 - 환경설정(EGit)
1. Window -> Preferences
2. General ->
Network Connections ->
SSH2
3. Key Management ->
Generate RSA Key...
4. Save Private Key...
5. Apply
설치 - 환경설정(EGit)
1. Window -> Preferences
2. Team -> Git
3. Cloning repositories
: Eclipse의 workspace 경로
4. Apply
설치 - 환경설정(Console)
1. 한글 Windows의 Console은
CodePage가 949
2. UTF-8 형식으로 변경
ex)
> chcp 65001
3. 속성-글꼴
: 래스터 글꼴 -> Lucida Console
* code page를 변경해야 한글이 정상적으로 표시
프로젝트 - github
1. 샘플 프로젝트를 위한
git서버로 github를 이용
2. 프로젝트 저장소 생성
프로젝트 - Eclipse(import)
1. File -> Import
2. Git -> Projects from Git
3. URI
4. Source Git Repository
: URI : 프로젝트 저장소의 주소
프로젝트 - Eclipse(import)
1. host(github)인증 만드는 것 확인
2. Branch Selection
프로젝트 - Eclipse(import)
2. Select a wizard use for importing projects
: 새로운 프로젝트 생성을 위해 Use the New Project wizard 선택
1. Local Destination
: 프로젝트 다운로드 받을 위치
프로젝트 - Eclipse(프로젝트 만들기)
1. Go Project 생성
2. 프로젝트 생성
: bin, pkg, src 를 기본으로 생성
프로젝트 - Eclipse(프로젝트 만들기)
1. 파일 추가
2. Source File Type
: Package Source File
: Command Source File
( Empty Main Function,
Main Function Parameters,
Simple Web Server )
: Test Source File
프로젝트 - Eclipse(프로젝트 만들기)
1. 패키지는 폴더로 구분
2. main 패키지 구성
: src/Sample1 과 같이 폴더 생성
3. calc 패키지 구성
: src/calc 와 같이 폴더 생성
* main도 하나의 패키지
프로젝트 - Eclipse(git-push)
크로스 컴파일 - 준비사항
1. Go는 개발환경에 상관없이
원하는 OS 와 CPU 타입의 binary를 만들어 낼 수 있음.
(windows-386, MinGW 설치)
2. 각 환경에 따른 세팅 값( 이외에도 몇 가지가 더 있음 )
OS GOOS GOARCH
윈도우 windows 386, amd64
리눅스 linux 386, amd64, arm
맥 darwin 386, amd64
크로스 컴파일 - 준비사항
3. C:Gosrc 로 이동
4. make.bat를 실행
5. 컴파일러, 링커 install
: arm(5), amd64(6), 386(8)
: a(assembler), c(c compiler),
g(compiler), l(linker)
ex)
> go tool dist install -v cmd/6a
> go tool dist install -v cmd/6c
> go tool dist install -v cmd/6g
> go tool dist install -v cmd/6l
크로스 컴파일 - 준비사항
6. Target 환경으로 설정 변경
ex)
> set GOOS=linux
> set GOARCH=amd64
> set CGO_ENABLED=0
7. 표준 명령, 라이브러리 Install
ex)
> go tool dist install -v pkg/runtime
> go install -v -a std
크로스 컴파일 - cmd
1. binary를 만들
OS와 ARCH를 지정
ex)
> set GOOS=linux
> set GOARCH=amd64
2. GOPATH 지정
: 빌드하고자 하는 프로젝트의 경로를 지정
: Sample1bin, pkg, src
ex)
> set GOPATH=C:UsersredefworkspaceSample1
크로스 컴파일 - cmd
3. 패키지 build & install
ex)
src> cd calc
calc> go install
: [결과물] pkglinux_amd64calc.a
4. main패키지 build & install
ex)
src> cd Sample1
Sample1> go install
: [결과물] binlinux_amd64Sample1
크로스 컴파일 - GoClipse
1. GoClipse에서 크로스 컴파일은 현재 가능하지 않음
2. GoClipse 이슈 목록
https://code.google.com/p/goclipse/issues/detail?id=99
https://code.google.com/p/goclipse/issues/detail?id=111
감사합니다.
참고
* http://golang.org/doc
* http://golang.org/cmd/
* http://woogyun.tistory.com/351
* http://bosoa.egloos.com/3893190
* http://www.youtube.com/watch?v=XCsL89YtqCs&feature=youtu.be
* http://www.vogella.com/articles/EGit/article.html
* https://code.google.com/p/goclipse/
* http://juhoi.tistory.com/46
* http://www.mirwing.com/2012/05/golang-cross-compiling.html
* https://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling
* http://gocor.eu/how-to-install-and-setup-go-on-windows-8/
* http://richitexperience.wordpress.com/2012/10/19/goclipse_preferences/
* http://ryulib.tistory.com/182
* http://www.drangon.org/mingw/

More Related Content

PPTX
go-qml
PPTX
Go 1.설치와 세팅
PPTX
OpenCV 에서 OpenCL 살짝 써보기
PDF
Go로 새 프로젝트 시작하기
PDF
Git이란 (Git 소개 및 기초 이론)
PDF
Grunt 사용법 간단정리
PDF
초보자를 위한 Git & GitHub
PDF
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습
go-qml
Go 1.설치와 세팅
OpenCV 에서 OpenCL 살짝 써보기
Go로 새 프로젝트 시작하기
Git이란 (Git 소개 및 기초 이론)
Grunt 사용법 간단정리
초보자를 위한 Git & GitHub
[숭실대학교 SODA]깃(git) 명령 및 소스트리(sourceTree) 실습

What's hot (20)

PDF
[NDC16] Effective Git
PPTX
pyOpenCL 입문
PPTX
이클립스로 GIT 사용하기
PPTX
이기종 멀티코어 프로세서를 위한 프로그래밍 언어 및 영상처리 오픈소스
PDF
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+github
PDF
Eclipse git 튜토리알
PDF
Git 더하기 GitHub(구름IDE 환경)
PDF
PyCon 2015 - 업무에서 빠르게 활용하는 PyQt
PDF
svn 능력자를 위한 git 개념 가이드
PDF
그루비로 안드로이드 앱 개발하기
PPTX
Introduction To Xaml
PPTX
PDF
Gruntjs
PDF
Git Tutorial
PDF
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅
PDF
버전관리시스템 종류와 소개
PPTX
LinqPad for DevOps
PPTX
Git 분산버전관리 시스템(1)
PDF
Git 사용법 공유 + Unity3D with git
PDF
Shiny Module
[NDC16] Effective Git
pyOpenCL 입문
이클립스로 GIT 사용하기
이기종 멀티코어 프로세서를 위한 프로그래밍 언어 및 영상처리 오픈소스
Git 더하기 GitHub(Git클라이언트 활용) / Getting started with git+github
Eclipse git 튜토리알
Git 더하기 GitHub(구름IDE 환경)
PyCon 2015 - 업무에서 빠르게 활용하는 PyQt
svn 능력자를 위한 git 개념 가이드
그루비로 안드로이드 앱 개발하기
Introduction To Xaml
Gruntjs
Git Tutorial
GDB와 strace로 Hang 걸린 Python Process 원격 디버깅
버전관리시스템 종류와 소개
LinqPad for DevOps
Git 분산버전관리 시스템(1)
Git 사용법 공유 + Unity3D with git
Shiny Module
Ad

Similar to Windows에서 go+eclipse 개발환경 구축 (20)

PDF
Html5+js with game engine cocos2d-html5 분석 @KGC2012
PPTX
공간정보아카데미 - Day1 오픈소스개발 일반
PDF
강좌 03 개발환경 구축
PDF
Android_01 Install Eclipse ADK/formatter/checker
PPTX
mago3D 기술 워크샵 자료(한국어)
PPTX
Mago3 d 워크샵
PPTX
mago3d workshop in FOSS4G Korea 2018
PDF
postgres_빌드_및_디버깅.pdf
PDF
Python을 이용한 Linux Desktop Application
PDF
DevOps - CI/CD 알아보기
PDF
게임개발 Cocos2d-x 소프트웨어씽킹연구소
PDF
게임개발 Cocos2d-x : 소프트웨어씽킹연구소
PDF
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
PDF
망고100 보드로 놀아보자 17
PDF
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
PDF
PyQGIS와 PyQt를 이용한 QGIS 기능 확장
PPTX
Python on Android
PDF
OpenStack DevStack Install - 2부 (Multi-nodes)
PDF
[1A6]Docker로 보는 서버 운영의 미래
PDF
Gradle Kotlin 컨벤션 플러그인으로 효율적으로 멀티 모듈 관리하기
Html5+js with game engine cocos2d-html5 분석 @KGC2012
공간정보아카데미 - Day1 오픈소스개발 일반
강좌 03 개발환경 구축
Android_01 Install Eclipse ADK/formatter/checker
mago3D 기술 워크샵 자료(한국어)
Mago3 d 워크샵
mago3d workshop in FOSS4G Korea 2018
postgres_빌드_및_디버깅.pdf
Python을 이용한 Linux Desktop Application
DevOps - CI/CD 알아보기
게임개발 Cocos2d-x 소프트웨어씽킹연구소
게임개발 Cocos2d-x : 소프트웨어씽킹연구소
[FOSS4G Korea 2021]Workshop-QGIS-TIPS-20211028
망고100 보드로 놀아보자 17
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
PyQGIS와 PyQt를 이용한 QGIS 기능 확장
Python on Android
OpenStack DevStack Install - 2부 (Multi-nodes)
[1A6]Docker로 보는 서버 운영의 미래
Gradle Kotlin 컨벤션 플러그인으로 효율적으로 멀티 모듈 관리하기
Ad

Windows에서 go+eclipse 개발환경 구축

  • 2. 목차 • 개요 • 설치 • 프로젝트 • 크로스 컴파일
  • 3. 개요 1. 목적 - Windows 환경에서 Go 언어를 이용하기 위한 개발 환경을 구축 ( Eclipse + GoClipse +EGit ) 2. 대상 - Go 언어를 처음 접해보는 사용자 - Eclipse를 처음 접해보는 사용자
  • 4. 설치 - 다운로드 및 설치 1. Go ( https://code.google.com/p/go/downloads/list?q=OpSys-Windows+Type%3DInstaller ) 2. Eclipse ( ver 3.7 이상) ( http://www.eclipse.org/downloads/ ) 3. GoClipse ( ver 0.7.6 ) ( https://code.google.com/p/goclipse/ ) ( http://goclipse.googlecode.com/svn/trunk/goclipse-update-site/ ) 4. EGit ( http://www.eclipse.org/egit/ ) ( http://download.eclipse.org/egit/updates/ )
  • 5. 설치 - GoClipse 1. Help -> Install New Software... 2. Work with 항목 ( http://goclipse.googlecode.com/svn/trunk/goclipse-update-site ) 3. Add 4. Add Repository에서 'OK' 선택
  • 6. 설치 - GoClipse 1. GoClipse -> Next -> Next 2. 라이센스동의 -> Finish 3. Eclipse 재시작
  • 7. 설치 - EGit 1. Help -> Install New Software... 2. Work with (http://download.eclipse.org/egit/updates/) 3. Add 4. Add Repository 에서 'OK' 선택
  • 8. 설치 - EGit 1. Eclipse EGit 선택 -> Next -> Next 2. 라이센스 동의 -> Finish 3. Eclipse 재시작
  • 9. 설치 - 환경설정(기본) 1. Window -> Preferences 2. GOROOT에 Go가 설치된 디렉토리를 선택 3. Apply * GOROOT아래에 bin디렉토리가 존재하면, Go Tools 항목은 자동으 로 채워짐
  • 10. 설치 - 환경설정(GDB) 1. gdb.exe ( http://www.equation.com/servlet/equation.cmd?fa=gdb ) ( http://www.drangon.org/mingw/ ) 바이너리 다운로드 2. GDB Path에 경로 추가
  • 11. 설치 - 환경설정(GDB) 1. Run-> Debug Configurations... 2. Go Application 3. 항목 Name : Debug 타이틀 Project : 디버깅을 진행 할 프로젝트 Main source file : main 메소드가 있는 파일 Arguments : 디버깅 옵션 Build configurations : DEBUG 4. Debug
  • 12. 설치 - 환경설정(GoCode) 2. gocode.exe (자동 완성) ( https://code.google.com/p/goclipse/downloads/list ) ( https://github.com/nsf/gocode ) 소스를 직접 빌드 3. GOROOTbin 에 복사
  • 13. 설치 - 환경설정(EGit) 1. Window -> Preferences 2. General -> Network Connections -> SSH2 3. Key Management -> Generate RSA Key... 4. Save Private Key... 5. Apply
  • 14. 설치 - 환경설정(EGit) 1. Window -> Preferences 2. Team -> Git 3. Cloning repositories : Eclipse의 workspace 경로 4. Apply
  • 15. 설치 - 환경설정(Console) 1. 한글 Windows의 Console은 CodePage가 949 2. UTF-8 형식으로 변경 ex) > chcp 65001 3. 속성-글꼴 : 래스터 글꼴 -> Lucida Console * code page를 변경해야 한글이 정상적으로 표시
  • 16. 프로젝트 - github 1. 샘플 프로젝트를 위한 git서버로 github를 이용 2. 프로젝트 저장소 생성
  • 17. 프로젝트 - Eclipse(import) 1. File -> Import 2. Git -> Projects from Git 3. URI 4. Source Git Repository : URI : 프로젝트 저장소의 주소
  • 18. 프로젝트 - Eclipse(import) 1. host(github)인증 만드는 것 확인 2. Branch Selection
  • 19. 프로젝트 - Eclipse(import) 2. Select a wizard use for importing projects : 새로운 프로젝트 생성을 위해 Use the New Project wizard 선택 1. Local Destination : 프로젝트 다운로드 받을 위치
  • 20. 프로젝트 - Eclipse(프로젝트 만들기) 1. Go Project 생성 2. 프로젝트 생성 : bin, pkg, src 를 기본으로 생성
  • 21. 프로젝트 - Eclipse(프로젝트 만들기) 1. 파일 추가 2. Source File Type : Package Source File : Command Source File ( Empty Main Function, Main Function Parameters, Simple Web Server ) : Test Source File
  • 22. 프로젝트 - Eclipse(프로젝트 만들기) 1. 패키지는 폴더로 구분 2. main 패키지 구성 : src/Sample1 과 같이 폴더 생성 3. calc 패키지 구성 : src/calc 와 같이 폴더 생성 * main도 하나의 패키지
  • 24. 크로스 컴파일 - 준비사항 1. Go는 개발환경에 상관없이 원하는 OS 와 CPU 타입의 binary를 만들어 낼 수 있음. (windows-386, MinGW 설치) 2. 각 환경에 따른 세팅 값( 이외에도 몇 가지가 더 있음 ) OS GOOS GOARCH 윈도우 windows 386, amd64 리눅스 linux 386, amd64, arm 맥 darwin 386, amd64
  • 25. 크로스 컴파일 - 준비사항 3. C:Gosrc 로 이동 4. make.bat를 실행 5. 컴파일러, 링커 install : arm(5), amd64(6), 386(8) : a(assembler), c(c compiler), g(compiler), l(linker) ex) > go tool dist install -v cmd/6a > go tool dist install -v cmd/6c > go tool dist install -v cmd/6g > go tool dist install -v cmd/6l
  • 26. 크로스 컴파일 - 준비사항 6. Target 환경으로 설정 변경 ex) > set GOOS=linux > set GOARCH=amd64 > set CGO_ENABLED=0 7. 표준 명령, 라이브러리 Install ex) > go tool dist install -v pkg/runtime > go install -v -a std
  • 27. 크로스 컴파일 - cmd 1. binary를 만들 OS와 ARCH를 지정 ex) > set GOOS=linux > set GOARCH=amd64 2. GOPATH 지정 : 빌드하고자 하는 프로젝트의 경로를 지정 : Sample1bin, pkg, src ex) > set GOPATH=C:UsersredefworkspaceSample1
  • 28. 크로스 컴파일 - cmd 3. 패키지 build & install ex) src> cd calc calc> go install : [결과물] pkglinux_amd64calc.a 4. main패키지 build & install ex) src> cd Sample1 Sample1> go install : [결과물] binlinux_amd64Sample1
  • 29. 크로스 컴파일 - GoClipse 1. GoClipse에서 크로스 컴파일은 현재 가능하지 않음 2. GoClipse 이슈 목록 https://code.google.com/p/goclipse/issues/detail?id=99 https://code.google.com/p/goclipse/issues/detail?id=111
  • 31. 참고 * http://golang.org/doc * http://golang.org/cmd/ * http://woogyun.tistory.com/351 * http://bosoa.egloos.com/3893190 * http://www.youtube.com/watch?v=XCsL89YtqCs&feature=youtu.be * http://www.vogella.com/articles/EGit/article.html * https://code.google.com/p/goclipse/ * http://juhoi.tistory.com/46 * http://www.mirwing.com/2012/05/golang-cross-compiling.html * https://code.google.com/p/go-wiki/wiki/WindowsCrossCompiling * http://gocor.eu/how-to-install-and-setup-go-on-windows-8/ * http://richitexperience.wordpress.com/2012/10/19/goclipse_preferences/ * http://ryulib.tistory.com/182 * http://www.drangon.org/mingw/