Google Go Programming In Eclipse

http://www.tutorialsavvy.com/2013/04/google-go-programming-in-eclipse.html/

Google Go Programming In Eclipse

 
  • The new “Go” programming language is from Google co.It has many features better then other languages.
  • Go language features are:-

            – High Speed Compilation             – Type and Memory safety             – Concurrency             – Efficient Garbage Collection

  • The Windows MSI Installer can be downloaded from the link:-

           http://code.google.com/p/go/downloads/list?q=OpSys-Windows+Type%3DInstaller

  • The Eclipse Plugin Update for Go programming Languages are downloaded from link:-

          http://goclipse.googlecode.com/svn/trunk/goclipse-update-site/

  • In this Demo ,We will see a Go programming in Eclipse Environment”.
  • After Updating Go plugin in Eclipse, we can set Go Configuration in Eclipse,
 
 
 
 
 
<img border="0" src="http://i0.wp.com/www.tutorialsavvy.com/wp-content/uploads/2013/04/go-setting-eclipse.jpg?w=667" data-recalc-dims="1" />
  • Create a new Go Project “GoLanguageDemo”  in Eclipse.
<img border="0" src="http://i0.wp.com/www.tutorialsavvy.com/wp-content/uploads/2013/04/go-project-eclipse.jpg?w=667" data-recalc-dims="1" />
  • A Google Go  project has these options,
<img border="0" src="http://i1.wp.com/www.tutorialsavvy.com/wp-content/uploads/2013/04/do_demo_web_server.jpg?w=667" data-recalc-dims="1" />
  •  The Go project structure in Eclipse,
<img border="0" src="http://i1.wp.com/www.tutorialsavvy.com/wp-content/uploads/2013/04/go-project-structure-eclipse.jpg?w=667" data-recalc-dims="1" />
  •  Lets Create a Go Program Listening to PORT no “9090”.Let the file name is do_demo.go file.Now The project Will look like,                                                                                                                                                                                                                                                        
    <img border="0" src="http://i0.wp.com/www.tutorialsavvy.com/wp-content/uploads/2013/04/go-prject-main-struct.jpg?w=667" data-recalc-dims="1" />

     

  • The  do_demo.go file,                
package main 
import ( "net/http" "fmt" )
/* Default Request Handler*/ func defaultHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<h1>Hello This is Sandeep.Testing Go Programming Language %s!</h1>", r.URL.Path[1:]) }
func main() { http.HandleFunc("/", defaultHandler) http.ListenAndServe(":9090", nil) }
  • The Run As option for go file is,
&amp;amp;lt;img border="0" src="http://i2.wp.com/www.tutorialsavvy.com/wp-content/uploads/2013/04/go-run-as-option.jpg?w=667" data-recalc-dims="1" /&amp;amp;gt;
  •  Now open up a browser and call the localhost for PORT 9090.
&amp;amp;lt;img border="0" src="http://i0.wp.com/www.tutorialsavvy.com/wp-content/uploads/2013/04/go-output.jpg?w=667" data-recalc-dims="1" /&amp;amp;gt;
Apr 11, 2013 Sandeep

转载于:https://www.cnblogs.com/kungfupanda/p/5571985.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值