FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
gonetworkmanager/examples/devices.go at develop · lmitdev/gonetworkmanager · GitHub
lmitdev
/
gonetworkmanager
Public
forked from
Wifx/gonetworkmanager
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
gonetworkmanager
/
examples
/
devices.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (30 loc) · 657 Bytes
Breadcrumbs
gonetworkmanager
/
examples
/
devices.go
Copy path
File metadata and controls
38 lines (30 loc) · 657 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package
main
import
(
"fmt"
"github.com/Wifx/gonetworkmanager"
"os"
)
func
main
() {
/* Create new instance of gonetworkmanager */
nm
,
err
:=
gonetworkmanager
.
NewNetworkManager
()
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
os
.
Exit
(
1
)
}
/* Get devices */
devices
,
err
:=
nm
.
GetPropertyAllDevices
()
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
os
.
Exit
(
1
)
}
/* Show each device path and interface name */
for
_
,
device
:=
range
devices
{
deviceInterface
,
err
:=
device
.
GetPropertyInterface
()
if
err
!=
nil
{
fmt
.
Println
(
err
.
Error
())
continue
}
fmt
.
Println
(
deviceInterface
+
" - "
+
string
(
device
.
GetPath
()))
}
os
.
Exit
(
0
)
}
Back
|
FazBrowse Home
|
New Git URL