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
hexadecimal-and-fields
Mike Holloway 4 years ago
parent 173e354269
commit b4b01a5cf4
  1. BIN
      main
  2. 21
      main.go

BIN
main

Binary file not shown.

@ -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()
}
Loading…
Cancel
Save