On branch read-file-error-check

Changes to be committed:
	new file:   main
		Perhaps add this to gitignore next time? Is it generally bad form?
	new file:   main.go
This commit is contained in:
Mike Holloway 2021-06-17 01:50:06 -04:00
parent 173e354269
commit b4b01a5cf4
2 changed files with 21 additions and 0 deletions

BIN
main Executable file

Binary file not shown.

21
main.go Normal file
View File

@ -0,0 +1,21 @@
package main
import (
"fmt"
"io/ioutil"
)
func check(e error) {
if e != nil {
panic(e)
}
}
func read_connections_file() {
var connections_file_path string = "/proc/net/tcp"
data, err := ioutil.ReadFile(connections_file_path)
check(err)
fmt.Println(string(data))
}
func main() {
read_connections_file()
}