mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-30 20:39:39 +02:00
22 lines
436 B
Go
22 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))
|
||
|
|
}
|
||
|
|
}
|