ooni-probe-cli/internal/engine/experiment/urlgetter
Simone Basso f4f3ed7c42
refactor(tracex): start applying recent code conventions (#773)
The code that is now into the tracex package was written a long
time ago, so let's start to make it more in line with the coding
style of packages that were written more recently.

I didn't apply all the changes I'd like to apply in a single diff
and for now I am committing just this diff.

Broadly, what we need to do is:

1. improve documentation

2. ~always use pointer receivers (object receives have the issue
that they are not mutable by accident meaning that you can mutate
them but their state do not change after the call returns, which
is potentially a source of bugs in case you later refactor to use
a pointer receiver, so always use pointer receivers)

3. ~always avoid embedding (let's say we want to avoid embedding
for types we define and it's instead fine to embed types that are
defined in the stdlib: if later we add a new method, we will not
see a broken build and we'll probably forget to add the new method
to all wrappers -- conversely, if we're wrapping rather than
embedding, we'll see a broken build and act accordingly)

4. prefer unit tests and group tests by type being tested rather
than using a flat structure for tests

There's a coverage slippage that I'll compensate in a follow-up diff where I'll focus on unit testing.

Reference issue: https://github.com/ooni/probe/issues/2121
2022-06-01 07:44:54 +02:00
..
.gitignore chore: merge probe-engine into probe-cli (#201) 2021-02-02 12:05:47 +01:00
configurer_test.go refactor(tracex): start applying recent code conventions (#773) 2022-06-01 07:44:54 +02:00
configurer.go refactor(netx): merge archival, trace, and the savers (#772) 2022-05-31 21:53:01 +02:00
getter_integration_test.go [forwardport] fix(netx): stop collecting HTTP performance metrics (#689) 2022-02-09 15:08:19 +01:00
getter_test.go feat: tutorial on how to write the torsf experiment (#390) 2021-06-22 00:12:03 +02:00
getter.go refactor(netx): merge archival, trace, and the savers (#772) 2022-05-31 21:53:01 +02:00
multi_test.go refactor: interfaces and data types into the model package (#642) 2022-01-03 13:53:23 +01:00
multi.go cleanup: use ErrorToStringOrOK func in other tests that returns nil (#701) 2022-03-08 11:59:44 +01:00
runner_test.go cleanup: merge httpheader and httpfailure into model (#758) 2022-05-25 09:54:50 +02:00
runner.go cleanup: merge httpheader and httpfailure into model (#758) 2022-05-25 09:54:50 +02:00
urlgetter_test.go fix: ensure experiments return nil when we want to submit (#654) 2022-01-07 13:17:20 +01:00
urlgetter.go refactor(netx): merge archival, trace, and the savers (#772) 2022-05-31 21:53:01 +02:00