dongzhengzhong1282 2019-03-07 22:52
浏览 105

go-windows-terminal-sequences \ sequences.go:输入中出现意外的NUL

I have problem when I run using library mux-logrus , but when using that , appear like this unexpected NUL in input , what's wrong with the library that I use ?

package main

import (
    "Go-SMSBlasts/app"
    "Go-SMSBlasts/controllers"
    "fmt"
    "github.com/gorilla/mux"
    "github.com/pytimer/mux-logrus"
    "net/http"
    "os"
)

func main() {

    r := mux.NewRouter()

    r.HandleFunc("/api/user/new", controllers.CreateAccount).Methods(http.MethodPost)
    r.HandleFunc("/api/user/login", controllers.Authenticate).Methods(http.MethodPost)
    r.HandleFunc("/api/user/getAllData",controllers.PostSMSBlastBySequenceIDAndMobilePhone).Methods(http.MethodPost)
    r.HandleFunc("/api/user/insert",controllers.InsertSMSBlast).Methods(http.MethodPost)
    r.Use(app.JwtAuthentication) //attach JWT auth middleware

    //logrus
    r.Use(muxlogrus.NewLogger().Middleware)


    port := os.Getenv("PORT") //Get port from .env file, we did not specify any port so this should return an empty string when tested locally
    if port == "" {
        port = "8000" //localhost
    }

    fmt.Println(port)

    err := http.ListenAndServe(":" + port, r) //Launch the app, visit localhost:8000/api
    if err != nil {
        fmt.Print(err)
    }

}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 mmocr的训练错误,结果全为0
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题
    • ¥50 如何用脚本实现输入法的热键设置
    • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
    • ¥30 深度学习,前后端连接
    • ¥15 孟德尔随机化结果不一致
    • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
    • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
    • ¥15 谁有desed数据集呀