我想问一下怎么使用GO实现这些方法?

a984120978 · · 1120 次点击
package main type F interface { read() string write() string open() close() } type f struct { name string err error } func main() { }
#2
更多评论
class File: name: str context: str file: open def __init__(self, name): self.name = name def open(self): self.file = open(self.name) def read(self): return self.file.read() def write(self, text): self.file.write(text) def close(self): self.file.close() def __del__(self): self.file.close()
#1
到这里就不会了
#3