var ErrNotADevice … var unixLstat … var osReadDir … func mkDev(d *Rule) (uint64, error) { … } // DeviceFromPath takes the path to a device and its cgroup_permissions (which // cannot be easily queried) to look up the information about a linux device // and returns that information as a Device struct. func DeviceFromPath(path, permissions string) (*Device, error) { … } // HostDevices returns all devices that can be found under /dev directory. func HostDevices() ([]*Device, error) { … } // GetDevices recursively traverses a directory specified by path // and returns all devices found there. func GetDevices(path string) ([]*Device, error) { … }