5-3 ioutil easy to read

main Package 

Import ( 
    " FMT " 
    " IO / ioutil " 
) 



FUNC main () { 
    // read in all data files developed, returns [] byte of the original data type 
    bytes, ERR: ioutil.ReadFile = ( " C: / the Users / Administrator / Desktop / eth address .txt " )
     IF ERR == nil {
         // use the string into a string forced 
        Content: = string (bytes) 
        fmt.Println (Content) 
    } the else { 
        fmt.Println ( " file read failure, ERR = " , ERR) 
    } 
}

 

Guess you like

Origin www.cnblogs.com/paad/p/11115832.html
5-3