Created
July 24, 2014 02:10
-
-
Save NotBadPad/c88411794b11de275a0c to your computer and use it in GitHub Desktop.
go:mysql-sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import ( | |
"/*{progect-name}*//utils" | |
) | |
/** | |
* struct | |
*/ | |
type Struct struct{ | |
name string | |
value string | |
} | |
/** | |
* query-one | |
*/ | |
func GetStruct(param string) (st *Struct, err error) { | |
sql_ := `` | |
stmt, err := utils.DB.Prepare(sql_) | |
if err != nil { | |
/*{log-engine}*/.("Error prepare sql:", err.Error()) | |
return | |
} | |
defer stmt.Close() | |
vmInfo = &VmInfo{} | |
if err = stmt.QueryRow(param).Scan(); err != nil { | |
/*{log-engine}*/.("GetStruct Error:", param, err.Error()) | |
return | |
} | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment