... | ... | @@ -148,6 +148,17 @@ for _, item := range list.Items { |
|
|
|
|
|
The _goto_ statements MUST NOT be used as they generally make the code flow harder to follow, and there are alternative ways to achieve the same behavior.
|
|
|
|
|
|
Unit Tests with Large Input
|
|
|
|
|
|
Suppose a test requires a long input string (e.g., an Kea entire configuration). We could could declare it in a constant or create a function returning this string, but the large blobs of text are hard to browse. We recommend moving the input text to a separate text file and using the _Golang embed_ mechanism to read the file into a variable in the test. For example:
|
|
|
|
|
|
```golang
|
|
|
//go:embed keaconfig_test_dhcp4_all_keys.json
|
|
|
var allKeysDHCPv4 []byte
|
|
|
```
|
|
|
|
|
|
where `keaconfig_test_dhcp4_all_keys.json` is in the same directory and contains the string blob.
|
|
|
|
|
|
# TypeScript Style
|
|
|
|
|
|
Used by UI. Details TBD
|
... | ... | |