github.com/mvdan/u-root-coreutils@v0.0.0-20230122170626-c2eef2898555/pkg/acpi/tables.go (about)

     1  // Copyright 2019 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build linux
     6  // +build linux
     7  
     8  package acpi
     9  
    10  import "fmt"
    11  
    12  // GetTable uses all the Methods until one works.
    13  func GetTable() (string, []Table, error) {
    14  	for m, f := range Methods {
    15  		t, err := f()
    16  		if err == nil {
    17  			return m, t, nil
    18  		}
    19  	}
    20  	return "", nil, fmt.Errorf("Could not get ACPI tables")
    21  }