refactor: make measurex depend on measurexlite (#892)
This diff makes `measurex` depend on `measurexlite` rather than the other way around. While there, add unit tests. Closes https://github.com/ooni/probe/issues/2240
This commit is contained in:
parent
7c1b2bbcb0
commit
8ca7645026
7 changed files with 312 additions and 71 deletions
|
|
@ -1,12 +1,6 @@
|
|||
package measurex
|
||||
|
||||
// NewFailure creates a serializable failure from an error. We
|
||||
// cannot round trip an error using JSON, so we serialize to this
|
||||
// intermediate format that is a sort of Optional<string>.
|
||||
func NewFailure(err error) *string {
|
||||
if err == nil {
|
||||
return nil
|
||||
}
|
||||
s := err.Error()
|
||||
return &s
|
||||
}
|
||||
import "github.com/ooni/probe-cli/v3/internal/measurexlite"
|
||||
|
||||
// NewFailure is an alias for measurexlite.NewFailure
|
||||
var NewFailure = measurexlite.NewFailure
|
||||
|
|
|
|||
Loading…
Reference in a new issue