美文网首页
Go Scanln和nohup一使用的坑

Go Scanln和nohup一使用的坑

作者: 霡霂976447044 | 来源:发表于2020-01-06 17:11 被阅读0次
    package main
    
    import "fmt"
    
    func main() {
        i := 10
        for {
            i--
            // if i <= 0 {
            //  return
    
            // }
            fmt.Println("Hello World!")
            var numStr string
            fmt.Scanln(&numStr)
            fmt.Printf("hello", "sdsdsd")
        }
    
    }
    
    

    当使用nohup部署的时候,Scanln函数会直接返回,导致日志文件巨大!
    使用python代码的读取用户输入如果使用nohup将会报错

    相关文章

      网友评论

          本文标题:Go Scanln和nohup一使用的坑

          本文链接:https://www.haomeiwen.com/subject/sovkactx.html