MCPcopy Create free account
hub / github.com/PacktPublishing/System-Programming-Essentials-with-Go / mountPoints

Function mountPoints

appendix-a/usb/main.go:133–150  ·  view source on GitHub ↗
(deviceNames []string)

Source from the content-addressed store, hash-verified

131}
132
133func mountPoints(deviceNames []string) ([]string, error) {
134 conn, err := dbus.ConnectSystemBus()
135 if err != nil {
136 return nil, fmt.Errorf("failed to connect to system bus: %v", err)
137 }
138 defer conn.Close()
139
140 var mps []string
141 for _, deviceName := range deviceNames {
142 mps1, err := retry(5, 200*time.Millisecond, deviceName, conn, fetchMountPoints)
143 if err != nil {
144 return nil, err
145 }
146 mps = append(mps1, mps...)
147 }
148
149 return mps, nil
150}
151
152func fetchMountPoints(deviceName string, conn *dbus.Conn) ([]string, error) {
153 var mountPoints []string

Callers 1

mainFunction · 0.70

Calls 1

retryFunction · 0.70

Tested by

no test coverage detected