...

Source file src/github.com/noirbizarre/gonja/utils/sets.go

Documentation: github.com/noirbizarre/gonja/utils

     1  package utils
     2  
     3  // // Create a set
     4  // set := make(map[int]struct{})
     5  
     6  // // Add some values
     7  // set[1] = struct{}{}
     8  // set[5] = struct{}{}
     9  
    10  // // Check if some values are in the set
    11  // if _, ok := set[1]; ok {
    12  // 	fmt.Println("1 is in the set")
    13  // }
    14  // if _, ok := set[2]; ok {
    15  // 	fmt.Println("2 is in the set")
    16  // }
    17  

View as plain text