Skip to content

Convert string returned from function as bytes #839

Answered by cueckoo
cueckoo asked this question in General
Discussion options

You must be logged in to vote

Original reply by @myitcv in cuelang/cue#839 (comment)

The canonical way to do this is via single-quote interpolation:

import "encoding/yaml"

some_field: bytes

some_field: '\(yaml.Marshal({}))'

Replies: 1 comment 1 reply

Comment options

cueckoo
Jul 3, 2021
Collaborator Author

You must be logged in to vote
1 reply
@cueckoo
Comment options

cueckoo Jul 3, 2021
Collaborator Author

Answer selected by cueckoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant