mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-15 20:05:13 +02:00
21 lines
436 B
Go
21 lines
436 B
Go
// File I/O — unsupported fixture.
|
|
// Entry is a method on a struct.
|
|
// Test sets confidence = Low to get Unsupported(ConfidenceTooLow).
|
|
// Entry: FileServer.Serve Cap: FILE_IO
|
|
// Expected verdict: Unsupported
|
|
|
|
package entry
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
)
|
|
|
|
type FileServer struct{ BaseDir string }
|
|
|
|
func (s *FileServer) Serve(path string) {
|
|
data, err := os.ReadFile(s.BaseDir + "/" + path)
|
|
if err == nil {
|
|
fmt.Print(string(data))
|
|
}
|
|
}
|