Skip to content

gopherzz/go-range-base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-range-base

Simple Range for Golang

For(func(int32))

package main

import (
  "fmt"
  
  gorng "github.com/gopherzz/go-range-base"
)

func main() {
  rng := gorng.New(0, 100)
  rng.For(func(i int32) { fmt.Println(i) })
}

Next() int32

package main

import (
  "fmt"
  
  gorng "github.com/gopherzz/go-range-base"
)

func main() {
  rng := gorng.Range{}.From(0).To(3)
  var a int32
  for i := rng; !i.IsLast(); i.Next() {
  	a++
  }
  if a != 3 {
  	t.Errorf("Excepted a == 3, get a = %d", a)
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages