来自自定义结构的Golang参考列表

I have the following block of code:

package main

import (
    "fmt"
    "container/list"
)

type Foo struct {
    foo list  //want a reference to the list implementation   
             //supplied by the language
}


func main() {
   //empty  

}

When compiling I receive the following message:

use of package list not in selector

My question is, how do I reference list within a struct? Or is this not the proper idiom in Go for wrapping structures. (Composition)

查看全部
dongye9820
dongye9820
2013/07/06 17:39
  • struct
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复