Code Monkey home page Code Monkey logo

Comments (6)

hellokaton avatar hellokaton commented on July 26, 2024

这和操作系统关系不大。

前提:由于项目中依赖了很多第三方库,你需要手动将他们先 go get 一下

配置数据库

  1. 你需要创建数据库并导入 database.sql 的脚本
  2. 你需要修改 Config/MySql.go 文件中的数据库配置

这个时候配置类的已经完成,如果在本地启动,大概是这样:

  1. 启动 http 服务端,执行 go run App/Server.go 即可
  2. 执行爬虫任务(因为是本地暂时不用定时任务),执行 go run App/GetHot.go 即可
  3. 使用浏览器打开 Html/hot.html 文件,使用 goland 直接右击使用浏览器打开就可以。

from toplist.

JimReno avatar JimReno commented on July 26, 2024

执行客户端文件出错

按照大佬的步骤,mysql的数据库应该是导入了(尴尬)
image

config没有修改,发现涉及到文件目录的都是相对路径。

配置完成后,启动了http服务端:
image

执行用户端的地方出现问题go run APP/GetHot.go,会报错:2019/09/02 17:45:57 错误:dial tcp: lookup tcp/port: getaddrinfow: The specified class was not found.
image

google了并没有出现能够解决这个问题的结果,搜索了issue也没有找到对应的解决方案 T.T,还请大佬帮忙判断一下哪里出了问题:)

from toplist.

mark988 avatar mark988 commented on July 26, 2024

syscall.SIGUSR1 windows 下编译报错。

from toplist.

mark988 avatar mark988 commented on July 26, 2024

Administrator@WINDOWS-O8ROA6P MINGW32 /e/project-example/go-project
$ go run App/Server.go
parse mysql config once. filePath: E:\project-example\go-project\Config\mysql.toml
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x1 addr=0x20 pc=0x74c784]

goroutine 1 [running]:
sync.(*Mutex).Lock(...)
D:/Go/src/sync/mutex.go:74
database/sql.(*DB).SetMaxOpenConns(0x0, 0x7d0)
D:/Go/src/database/sql/sql.go:899 +0x34
/E/project-example/go-project/Common.init.0()
E:/project-example/go-project/Common/Db.go:41 +0xe7
exit status 2

Administrator@WINDOWS-O8ROA6P MINGW32 /e/project-example/go-project

from toplist.

JimReno avatar JimReno commented on July 26, 2024

@mark988 可以看下这个 #8 应该能解决你的问题

from toplist.

h1z3y3 avatar h1z3y3 commented on July 26, 2024

#53

from toplist.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.