fix(internal/platform): support freebsd (#445)
See https://github.com/ooni/probe/issues/1696
This commit is contained in:
parent
c3bec9de2a
commit
2e5b4f13dd
|
@ -16,7 +16,9 @@ import "runtime"
|
||||||
//
|
//
|
||||||
// 4. "windows"
|
// 4. "windows"
|
||||||
//
|
//
|
||||||
// 5. "unknown"
|
// 5. "freebsd"
|
||||||
|
//
|
||||||
|
// 6. "unknown"
|
||||||
//
|
//
|
||||||
// You should use this name to annotate measurements.
|
// You should use this name to annotate measurements.
|
||||||
func Name() string {
|
func Name() string {
|
||||||
|
@ -30,7 +32,7 @@ func name(goos string) string {
|
||||||
//
|
//
|
||||||
// See https://golang.org/doc/go1.16#darwin
|
// See https://golang.org/doc/go1.16#darwin
|
||||||
switch goos {
|
switch goos {
|
||||||
case "android", "linux", "windows", "ios":
|
case "android", "freebsd", "ios", "linux", "windows":
|
||||||
return goos
|
return goos
|
||||||
case "darwin":
|
case "darwin":
|
||||||
return "macos"
|
return "macos"
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
func TestGood(t *testing.T) {
|
func TestGood(t *testing.T) {
|
||||||
var expected bool
|
var expected bool
|
||||||
switch Name() {
|
switch Name() {
|
||||||
case "android", "ios", "linux", "macos", "windows":
|
case "android", "freebsd", "ios", "linux", "macos", "windows":
|
||||||
expected = true
|
expected = true
|
||||||
}
|
}
|
||||||
if !expected {
|
if !expected {
|
||||||
|
@ -23,6 +23,9 @@ func TestName(t *testing.T) {
|
||||||
}{{
|
}{{
|
||||||
expected: "android",
|
expected: "android",
|
||||||
goos: "android",
|
goos: "android",
|
||||||
|
}, {
|
||||||
|
expected: "freebsd",
|
||||||
|
goos: "freebsd",
|
||||||
}, {
|
}, {
|
||||||
expected: "ios",
|
expected: "ios",
|
||||||
goos: "ios",
|
goos: "ios",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user