aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/container/vector
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/container/vector')
-rw-r--r--src/pkg/container/vector/intvector.go4
-rw-r--r--src/pkg/container/vector/stringvector.go4
-rw-r--r--src/pkg/container/vector/vector.go4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/pkg/container/vector/intvector.go b/src/pkg/container/vector/intvector.go
index f599ce185c..076f9982d2 100644
--- a/src/pkg/container/vector/intvector.go
+++ b/src/pkg/container/vector/intvector.go
@@ -101,7 +101,7 @@ func (p *IntVector) Less(i, j int) bool {
// Iterate over all elements; driver for range
-func (p *IntVector) iterate(c chan int) {
+func (p *IntVector) iterate(c chan<- int) {
for i, v := range p.a {
c <- v.(int)
}
@@ -110,7 +110,7 @@ func (p *IntVector) iterate(c chan int) {
// Channel iterator for range.
-func (p *IntVector) Iter() chan int {
+func (p *IntVector) Iter() <-chan int {
c := make(chan int);
go p.iterate(c);
return c;
diff --git a/src/pkg/container/vector/stringvector.go b/src/pkg/container/vector/stringvector.go
index 4f6d74e29a..2ead95c701 100644
--- a/src/pkg/container/vector/stringvector.go
+++ b/src/pkg/container/vector/stringvector.go
@@ -100,7 +100,7 @@ func (p *StringVector) Less(i, j int) bool {
// Iterate over all elements; driver for range
-func (p *StringVector) iterate(c chan string) {
+func (p *StringVector) iterate(c chan<- string) {
for i, v := range p.a {
c <- v.(string)
}
@@ -109,7 +109,7 @@ func (p *StringVector) iterate(c chan string) {
// Channel iterator for range.
-func (p *StringVector) Iter() chan string {
+func (p *StringVector) Iter() <-chan string {
c := make(chan string);
go p.iterate(c);
return c;
diff --git a/src/pkg/container/vector/vector.go b/src/pkg/container/vector/vector.go
index 5b5cad21cd..ba5e881d16 100644
--- a/src/pkg/container/vector/vector.go
+++ b/src/pkg/container/vector/vector.go
@@ -228,7 +228,7 @@ func (p *Vector) Swap(i, j int) {
// Iterate over all elements; driver for range
-func (p *Vector) iterate(c chan Element) {
+func (p *Vector) iterate(c chan<- Element) {
for i, v := range p.a {
c <- v
}
@@ -237,7 +237,7 @@ func (p *Vector) iterate(c chan Element) {
// Channel iterator for range.
-func (p *Vector) Iter() chan Element {
+func (p *Vector) Iter() <-chan Element {
c := make(chan Element);
go p.iterate(c);
return c;