文件操作 - pointer.go
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/go-1.23/test/interface/pointer.go
编辑文件内容
// errorcheck // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Test that interface{M()} = *interface{M()} produces a compiler error. // Does not compile. package main type Inst interface { Next() *Inst } type Regexp struct { code []Inst start Inst } type Start struct { foo *Inst } func (start *Start) Next() *Inst { return nil } func AddInst(Inst) *Inst { print("ok in addinst\n") return nil } func main() { print("call addinst\n") var _ Inst = AddInst(new(Start)) // ERROR "pointer to interface|incompatible type" print("return from addinst\n") var _ *Inst = new(Start) // ERROR "pointer to interface|incompatible type" }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件