Changes to be committed: new file: main Perhaps add this to gitignore next time? Is it generally bad form? new file: main.gohexadecimal-and-fields
parent
173e354269
commit
b4b01a5cf4
2 changed files with 21 additions and 0 deletions
@ -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…
Reference in new issue