This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"slices" | |
"strconv" | |
"testing" | |
) | |
func Test_partition(t *testing.T) { | |
t.Run("strings", func(t *testing.T) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"io" | |
"log" | |
"os" | |
"path/filepath" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"strconv" | |
"strings" | |
"text/scanner" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"os" | |
"os/signal" | |
"sync" | |
) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "golang.org/x/exp/slices" | |
func FilterFunc[T any](list []T, keep func(T) bool) []T { | |
filtered := make([]T, 0, len(list)) | |
for _, e := range list { | |
if keep(e) { | |
filtered = append(filtered, e) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "golang.org/x/exp/maps" | |
type Set[T comparable] map[T]struct{} | |
func (s Set[T]) Add(v T) { s[v] = struct{}{} } | |
func (s Set[T]) Remove(v T) { delete(s, v) } | |
func (s Set[T]) Has(v T) bool { _, has := s[v]; return has } | |
func (s Set[T]) List() []T { return maps.Keys(s) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bufio" | |
"context" | |
"fmt" | |
"os" | |
"os/exec" | |
"os/signal" | |
"regexp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<style> | |
#result { | |
width: 100%; | |
padding: 1rem; | |
font-size: 2rem; | |
border-top-left-radius: 1rem; | |
border-top-right-radius: 1rem; | |
background: HSLA(336, 20%, 9%, 1.00); | |
color: white; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "reflect" | |
func loadConfig(data interface{}) { | |
v := reflect.ValueOf(data) | |
if v.Kind() != reflect.Ptr || v.Type().Elem().Kind() != reflect.Struct { | |
panic("expected a pointer to a struct") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It would be so cool if we could have vsphere environemnts act more like other iaas environments. | |
- It would make VSphere tests more like the other IAAS test pipelines. | |
- It would allow us to use the same workspace scripts (maybe) to interact with the environments. | |
- It would allow us to have a smaller pool of environments (because we install ops manager in the test pipeline) | |
The following outline is an exploration tracing the usage of the environment resource through the test pipelines. The | |
test pipeline ert::2.11 is used throughout as a the template I am following the GCP clean test: | |
- job: acquire-lock-gcp-clean | |
description: acquire a lock from the releng-env-resource pool. This writes an empty file to the gate-locks directory |
NewerOlder