鍍金池/ 問(wèn)答/GO/ go exe程序閃退,如何處理?

go exe程序閃退,如何處理?

package main
import(
"os"
"fmt"
"io/ioutil"
"./words"
"time"
)

func main(){

fileName:=os.Args[1]
contents,err:=ioutil.ReadFile(fileName)
if(err!=nil){
  fmt.Println(err)
  return 
  }
  text:=string(contents)
  count:=words.CountWords(text);
  fmt.Println("There are %d words in your text.\n",count)
  

   
  time.Sleep(50*time.Second)

}

上面生成exe閃退 ,最后的睡眠設(shè)置沒(méi)起作用 ,這個(gè)是什么問(wèn)題

回答
編輯回答
尛憇藌

err!=nil

2018年9月1日 20:41