-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathdingo.toml.example
More file actions
63 lines (54 loc) · 2.23 KB
/
dingo.toml.example
File metadata and controls
63 lines (54 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Dingo Configuration File
# This file controls the behavior of the Dingo transpiler
[features]
# Error propagation operator syntax
# Valid values: "question" (?), "bang" (!), "try" (try keyword)
error_propagation_syntax = "question"
# Reuse "err" variable instead of generating __err0, __err1, etc.
# When true: Generates cleaner code with reused "err" variable (more idiomatic)
# When false: Generates unique names like __err0, __err1 (safer, avoids shadowing)
# Default: true
reuse_err_variable = true
# Nil safety checks for pattern destructuring in sum types
# Valid values: "off", "on", "debug"
# - off: No nil checks (trust constructors, maximum performance)
# - on: Always check with runtime panic (safe, recommended)
# - debug: Check only when DINGO_DEBUG environment variable is set
# Default: "on"
nil_safety_checks = "on"
[features.result_type]
# Enable Result<T, E> type for error handling
# Default: true
enabled = true
# Go interoperability mode for (T, error) returns
# Valid values: "opt-in", "auto", "disabled"
# - "opt-in": Requires explicit Result.FromGo() wrapper (safe, recommended)
# Example: let user = Result.FromGo(fetchUser(id))
# - "auto": Automatically wraps (T, error) → Result<T, E>
# Example: let user = fetchUser(id) // Auto-wrapped to Result
# - "disabled": No Go interop, pure Dingo types only
# Default: "opt-in"
go_interop = "opt-in"
[features.option_type]
# Enable Option<T> type for null safety
# Default: true
enabled = true
# Go interoperability mode for pointer types (*T)
# Valid values: "opt-in", "auto", "disabled"
# - "opt-in": Requires explicit Option.FromPtr() wrapper (safe, recommended)
# Example: let user = Option.FromPtr(findUser(id))
# - "auto": Automatically wraps *T → Option<T>
# Example: let user = findUser(id) // Auto-wrapped to Option
# - "disabled": No Go interop, pure Dingo types only
# Default: "opt-in"
go_interop = "opt-in"
[sourcemaps]
# Enable source map generation for better debugging and IDE support
enabled = true
# Source map output format
# Valid values: "inline", "separate", "both", "none"
# - inline: Embeds source maps as comments in .go files
# - separate: Writes .go.map files
# - both: Generates both inline and separate files
# - none: Disables source maps
format = "inline"