我正在开发一个用于编译源的 Ansible 模块,例如
- source_compile:
archive: /var/cache/sources/nginx.tar.gz
configure:
prefix: /usr
我可能会
所以我想使用ansible核心模块get_url和unarchive和shell,但没有找到如何。
struct A {}
func (a *A) BName(id int) string {
return a.Name
}
struct B {
*A
Name string
}
func main() {
b := &B{Name: "abc"}
fmt.Println(b.Name)
}
Run Code Online (Sandbox Code Playgroud)
代码失败,我想知道如何编写代码来实现,A.BName可以访问B struct属性Name