Skip to content

Commit

Permalink
Merge pull request #43 from yrong/master
Browse files Browse the repository at this point in the history
兼容性改进,支持go modules方式安装
  • Loading branch information
timeromantic authored Sep 23, 2019
2 parents 7be3fb1 + e98f463 commit d7a1599
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
2 changes: 1 addition & 1 deletion App/GetHot.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"../Common"
"github.com/tophubs/TopList/Common"
"bytes"
"encoding/json"
"fmt"
Expand Down
5 changes: 2 additions & 3 deletions App/Server.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import (
"net/http"
"regexp"
"text/template"

"../Common"
"../Config"
"github.com/tophubs/TopList/Common"
"github.com/tophubs/TopList/Config"
)

func GetTypeInfo(w http.ResponseWriter, r *http.Request) {
Expand Down
2 changes: 1 addition & 1 deletion Common/Db.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package Common

import (
"../Config"
"github.com/tophubs/TopList/Config"
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
Expand Down
4 changes: 2 additions & 2 deletions Common/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ CREATE TABLE `hotData2` (
PRIMARY KEY (`id`),
KEY `hotData2__index_key` (`dataType`),
KEY `hotData2__index_name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
) ENGINE=InnoDB AUTO_INCREMENT=114 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
Expand All @@ -54,4 +54,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2019-08-14 11:42:15
-- Dump completed on 2019-08-14 11:42:15
4 changes: 2 additions & 2 deletions Config/mysql.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Source = "user:password@tcp(ip:port)/database?charset=utf8mb4"
Driver = "mysql"
Source = "root:root@tcp(127.0.0.1:3306)/news?charset=utf8mb4"
Driver = "mysql"
11 changes: 11 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module github.com/tophubs/TopList

go 1.13

require (
github.com/BurntSushi/toml v0.3.1
github.com/PuerkitoBio/goquery v1.5.0 // indirect
github.com/bitly/go-simplejson v0.5.0 // indirect
github.com/go-sql-driver/mysql v1.4.1
golang.org/x/text v0.3.2 // indirect
)
16 changes: 16 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/PuerkitoBio/goquery v1.5.0 h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk=
github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o=
github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/bitly/go-simplejson v0.5.0 h1:6IH+V8/tVMab511d5bn4M7EwGXZf9Hj6i2xSwkNEM+Y=
github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA=
github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA=
github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a h1:gOpx8G595UYyvj8UK4+OFyY4rx037g3fmfhe5SasG3U=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

0 comments on commit d7a1599

Please sign in to comment.