Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Convert string returned from function as bytes #839

Answered by myitcv
uhthomas asked this question in General
Discussion options

You must be logged in to vote

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

import "encoding/yaml"

some_field: bytes

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

Replies: 2 comments 1 reply

Comment options

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

Answer selected by uhthomas
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants