()
| 299 | } |
| 300 | |
| 301 | func GetLinuxStorageBackend() (string, error) { |
| 302 | if runtime.GOOS != "linux" { |
| 303 | return "", nil |
| 304 | } |
| 305 | |
| 306 | lock.Lock() |
| 307 | defer lock.Unlock() |
| 308 | |
| 309 | if linuxStorageBackend != "" { |
| 310 | return linuxStorageBackend, nil |
| 311 | } |
| 312 | |
| 313 | if err := getLinuxStorageBackend(); err != nil { |
| 314 | return "", err |
| 315 | } |
| 316 | |
| 317 | if linuxStorageBackend == "" { |
| 318 | return "", fmt.Errorf("failed to determine linux storage backend") |
| 319 | } |
| 320 | |
| 321 | return linuxStorageBackend, nil |
| 322 | } |
no test coverage detected