Browse Source

Function name uppdate

Vladimir Vivien 3 năm trước cách đây
mục cha
commit
ba8c73f293
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 2 1
      v4l2/device/list.go
  2. 1 1
      v4l2/device/list_test.go

+ 2 - 1
v4l2/device/list.go

@@ -32,7 +32,8 @@ func IsDevice(devpath string) (bool, error) {
 	return false, nil
 	return false, nil
 }
 }
 
 
-func List() ([]string, error) {
+// GetAllDevicePaths return a slice of all mounted v4l2 devices
+func GetAllDevicePaths() ([]string, error) {
 	entries, err := os.ReadDir(root)
 	entries, err := os.ReadDir(root)
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

+ 1 - 1
v4l2/device/list_test.go

@@ -5,7 +5,7 @@ import (
 )
 )
 
 
 func TestList(t *testing.T){
 func TestList(t *testing.T){
-	devices, err := List()
+	devices, err := GetAllDevicePaths()
 	if err != nil {
 	if err != nil {
 		t.Error(err)
 		t.Error(err)
 	}
 	}