内容简介:GO现在比较流行的游戏等服务器开发语言。配置beego 插件:配置如图选项到环境变量(如果没有该项着新建一个覆盖)
GO现在比较流行的游戏等服务器开发语言。
配置beego 插件:
配置如图选项到环境变量(如果没有该项着新建一个覆盖)
然后在该目录下引入 beego插件
$ go get github.com/astaxie/beego $ go get github.com/beego/bee
执行这两个命令之后 会在目录中新增三个文件夹
为了更加方便的操作,请将 $GOPATH/bin
加入到你的 $PATH
变量中。
快速创建一个项目:
$ cd $GOPATH/src $ bee new hello $ cd hello $ bee run hello
一旦程序开始运行,您就可以在浏览器中打开 http://localhost:8080/ 进行访问。
开始一个“Holle,world”吧:
在文件中 找到“controllers/default.go”写入代码
package controllers import ( "github.com/astaxie/beego" ) type MainController struct { beego.Controller } func (c *MainController) Get() { c.Ctx.WriteString("hello world") //c.Data["Website"] = "beego.me" //c.Data["Email"] = "astaxie@gmail.com" //c.TplName = "index.tpl" }
在运行”main.go”即可
更详细内容如下链接:
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
猜你喜欢:本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Beginning XSLT 2.0
Jeni Tennison / Apress / 2005-07-22 / USD 49.99
This is an updated revision of Tennison's "Beginning XSLT", updated for the new revision of the XSLT standard. XSLT is a technology used to transform an XML document with one structure into another ......一起来看看 《Beginning XSLT 2.0》 这本书的介绍吧!