Skip to content

Instantly share code, notes, and snippets.

@spytheman
Created August 1, 2020 10:28
Show Gist options
  • Select an option

  • Save spytheman/2dfc9c925e766c87e4c9023b294d2132 to your computer and use it in GitHub Desktop.

Select an option

Save spytheman/2dfc9c925e766c87e4c9023b294d2132 to your computer and use it in GitHub Desktop.
import os
import json
struct User { name string age int = 30 }
fn main(){
u := User{ name: os.args[1..].join(' ') }
smessage := json.encode(u)
C.write(1, &smessage.len, 4)
C.write(1, smessage.str, smessage.len)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment