mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
* e2e tst: add actions to create github org (#56775) * add basic actions to create org * e2e tst: add actions to create github users (#56776) * add basic actions to create and get users * fix adminUser * add unique id to user email * e2e tst: add actions to create github teams (#56777) * add basic actions to manage teams * e2e tst: add actions to create repos (#56778) --------- Co-authored-by: Petri-Johan Last <petri.last@sourcegraph.com> Co-authored-by: Jean-Hadrien Chabran <jean-hadrien.chabran@sourcegraph.com>
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
package codehost_testing
|
|
|
|
import "fmt"
|
|
|
|
// Reporter defines an interface for writing formatted output.
|
|
type Reporter interface {
|
|
Writef(format string, args ...any) (int, error)
|
|
Writeln(v string) (int, error)
|
|
}
|
|
|
|
// ConsoleReporter implements the Reporter interface for writing to stdout
|
|
type ConsoleReporter struct{}
|
|
|
|
// NoopReporter implements the Reporter interface by providing no-op operations
|
|
type NoopReporter struct{}
|
|
|
|
// Writef writes the args to the console according the specified format
|
|
func (r ConsoleReporter) Writef(format string, args ...any) (int, error) {
|
|
return fmt.Printf(format, args...)
|
|
}
|
|
|
|
// Writeln writes the args to the console according to the specified format with a newline
|
|
func (r ConsoleReporter) Writeln(v string) (int, error) {
|
|
return fmt.Println(v)
|
|
}
|
|
|
|
// Writef is a no-op for NoopReporter
|
|
func (r NoopReporter) Writef(format string, args ...any) (int, error) {
|
|
return 0, nil
|
|
}
|
|
|
|
// Writeln is a no-op for NoopReporter
|
|
func (r NoopReporter) Writeln(v string) (int, error) {
|
|
return 0, nil
|
|
}
|