Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ld
go-ld-prime
Commits
cbef5c3e
Commit
cbef5c3e
authored
Mar 29, 2020
by
Eric Myhre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix excessing pointers in maybes.
parent
14e6653c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
schema/gen/go/genString.go
schema/gen/go/genString.go
+2
-2
No files found.
schema/gen/go/genString.go
View file @
cbef5c3e
...
@@ -67,11 +67,11 @@ func (g stringGenerator) EmitNativeMaybe(w io.Writer) {
...
@@ -67,11 +67,11 @@ func (g stringGenerator) EmitNativeMaybe(w io.Writer) {
func (m Maybe{{ .Type | TypeSymbol }}) Exists() bool {
func (m Maybe{{ .Type | TypeSymbol }}) Exists() bool {
return m.m == schema.Maybe_Value
return m.m == schema.Maybe_Value
}
}
func (m Maybe{{ .Type | TypeSymbol }}) Must()
*
{{ .Type | TypeSymbol }} {
func (m Maybe{{ .Type | TypeSymbol }}) Must() {{ .Type | TypeSymbol }} {
if !m.Exists() {
if !m.Exists() {
panic("unbox of a maybe rejected")
panic("unbox of a maybe rejected")
}
}
return
&
m.n
return m.n
}
}
`
,
w
,
g
.
AdjCfg
,
g
)
`
,
w
,
g
.
AdjCfg
,
g
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment