草庐IT

lissajous

全部标签

go - go 函数的包选择错误

我正在从一本书中学习,这本书说要添加几行代码,但会引发错误packagemainimport("./lissajous""log""net/http")funcmain(){handler:=func(whttp.ResponseWriter,r*http.Request){lissajous(w)}http.HandleFunc("/",handler)//eachrequestcallshandlerlog.Fatal(http.ListenAndServe("localhost:8000",nil))}它抛出这个错误./server.go:6:importedandnotused

go - 如何调试 gif 错误

我关注guidebyAlanDonovan并尝试制作gif。但是在输出中我总是得到不可读的gif图像。我记得,当我在Windows8.0上时,我可以轻松地重新制作这个示例,但今天在Ubuntu16.04上,我不知道我的错误在哪里以及如何修复它。我的代码:packagemainimport("image/color""os""io""math/rand""time""image/gif""image""math")varpalette=[]color.Color{color.White,color.Black}const(whiteIndex=0blackIndex=1)funcmain