mirror of
https://github.com/criyle/go-judge.git
synced 2025-11-04 14:50:02 +08:00
13 lines
192 B
Go
13 lines
192 B
Go
package file
|
|
|
|
import (
|
|
"bytes"
|
|
"os"
|
|
|
|
"github.com/criyle/go-sandbox/pkg/memfd"
|
|
)
|
|
|
|
func (m *memFile) Open() (*os.File, error) {
|
|
return memfd.DupToMemfd(m.name, bytes.NewReader(m.content))
|
|
}
|