netxlite: improve docs, tests, and code quality (#493)
* netxlite: improve docs, tests, and code quality * better documentation * more strict testing of dialer (especially make sure we document the quirk in https://github.com/ooni/probe/issues/1779 and we have tests to guarantee we don't screw up here) * introduce NewErrWrapper factory for creating errors so we have confidence we are creating them correctly Part of https://github.com/ooni/probe/issues/1591
This commit is contained in:
parent
e68adec9a5
commit
3cd88debdc
12 changed files with 452 additions and 141 deletions
|
|
@ -29,6 +29,8 @@ import (
|
|||
//
|
||||
// This is CLEARLY a QUIRK anyway. There may code depending on how
|
||||
// we do things here and it's tricky to remove this behavior.
|
||||
//
|
||||
// See TODO(https://github.com/ooni/probe/issues/1779).
|
||||
func quirkReduceErrors(errorslist []error) error {
|
||||
if len(errorslist) == 0 {
|
||||
return nil
|
||||
|
|
@ -49,6 +51,8 @@ func quirkReduceErrors(errorslist []error) error {
|
|||
//
|
||||
// It saddens me to have this quirk, but it is here to pair
|
||||
// with quirkReduceErrors, which assumes that <facepalm>.
|
||||
//
|
||||
// See TODO(https://github.com/ooni/probe/issues/1779).
|
||||
func quirkSortIPAddrs(addrs []string) (out []string) {
|
||||
isIPv6 := func(x string) bool {
|
||||
// This check for identifying IPv6 is discussed
|
||||
|
|
|
|||
Loading…
Reference in a new issue