Format and specification code
This commit is contained in:
@@ -39,10 +39,11 @@ CREATE TABLE `userdetail` (
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
//"time"
|
||||
|
||||
_ "github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -38,6 +38,7 @@ import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ package main
|
||||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
|
||||
|
||||
11
zh/05.6.md
11
zh/05.6.md
@@ -22,11 +22,12 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/garyburd/redigo/redis"
|
||||
"os"
|
||||
"os/signal"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/garyburd/redigo/redis"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -103,8 +104,9 @@ https://github.com/astaxie/goredis
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/astaxie/goredis"
|
||||
"fmt"
|
||||
|
||||
"github.com/astaxie/goredis"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -158,9 +160,10 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"gopkg.in/mgo.v2"
|
||||
"gopkg.in/mgo.v2/bson"
|
||||
"log"
|
||||
)
|
||||
|
||||
type Person struct {
|
||||
|
||||
@@ -68,9 +68,10 @@ package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/julienschmidt/httprouter"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
func Index(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
|
||||
|
||||
@@ -33,8 +33,9 @@ log.WithFields(log.Fields{
|
||||
package main
|
||||
|
||||
import (
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"os"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -122,8 +123,9 @@ package logs
|
||||
import (
|
||||
// "errors"
|
||||
"fmt"
|
||||
seelog "github.com/cihub/seelog"
|
||||
// "io"
|
||||
|
||||
seelog "github.com/cihub/seelog"
|
||||
)
|
||||
|
||||
var Logger seelog.LoggerInterface
|
||||
|
||||
Reference in New Issue
Block a user