revel

    0熱度

    1回答

    我想在golang中實現繼承。 下面是例子: type A struct { Number int } type B struct{ A name String } func (a A) GetNumber() { // Here I want to use instance of B fmt.Println(a) // but thi

    0熱度

    1回答

    如何訪問Go模板範圍內的範圍? 模板: {{range .Resume.Skills}} {{.Name}} {{.Level}} {{range $item, $key := .Keywords}} {{$key}} {{$item}} {{end}} {{end}} 結構: type SkillsInfo struct

    0熱度

    1回答

    我在golang很新,但我很努力.. 我試圖通過發送請求給酒吧控制器,並解析它在狂歡的一面json。 不過,雖然得到的結果,我不能解組......我要送一個數組 json_encode(array("one","two","three")) 但我不能找到這樣的數據一起工作的正確途徑。我不知道我是否需要發送與否之前進行JSON .. func (c KpiCtrl) GetData() reve

    0熱度

    1回答

    我想在Revel + Gorm(或Golang中的任何其他ORM)中設置像https://github.com/thiagopradi/octopus這樣的數據庫分片。 我將得到db連接字符串安全過濾器(這是一個自定義過濾器,在狂歡的參數過濾器後添加)。現在我需要在下一個自定義過濾器中調用db連接,稱爲db過濾器 而且還需要在revel應用程序啓動時實現db連接池。

    12熱度

    1回答

    我正在使用Golang Revel進行一些網絡項目,並且目前爲止我做了12個項目。在他們所有人中,由於返回類型,我有很多代碼冗餘。看看這兩個函數: func (c Helper) Brands() []*models.Brand{ //do some select on rethinkdb and populate correct model var brands []*mo

    0熱度

    1回答

    我無法使用Revel檢索表單數據。儘管我能夠檢索查詢參數。 我有這樣的控制器來測試c.Params內容: func (c UserController) SaveUser() revel.Result { return c.RenderJson(c.Params) //just for check the content } 當我通過查詢參數(密押,值),我得到: { "

    0熱度

    1回答

    (EDITING修復大小寫並添加上下文) 在revel的init.go中,我有一個全局var:DB。 package app import ( "database/sql" "fmt" _ "github.com/go-sql-driver/mysql" "github.com/revel/revel" ) var DB *sql.DB func InitDB() { co

    0熱度

    1回答

    我有一個帶有動態輸入數量的html表單。每個輸入必須是一個Model對象,並且我還有一個函數,它接收來自這個輸入的值。 我的HTML表單: <form action="{{url "Votes.CreateVote"}}" id="formVoteCreate" method="POST"> <p class="field"> <label>Question:</la

    0熱度

    1回答

    與golang格姆ORM玩弄,我已經理解了以下問題: 我的模型看起來像: package models import ( "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/sqlite" ) type Book struct { gorm.Model Title string `

    3熱度

    1回答

    我們如何配置IntelliJ來調試狂歡應用程序? 在Run/Debug Configurations,它不是在所有明顯發生了什麼,爲File,Go tool arguments,並和Program arguments