Skip to content

Instantly share code, notes, and snippets.

@rccc
Created March 20, 2023 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rccc/71e814f8bf49073f5617b169e3b653cc to your computer and use it in GitHub Desktop.
Save rccc/71e814f8bf49073f5617b169e3b653cc to your computer and use it in GitHub Desktop.
import os
fn main(){
mut handler := os.create('test.txt') or { panic(err) }
handler.write_string('Hello World!') or { panic(err) }
handler.close()
}
@thomas-mangin
Copy link

import os

fn main(){

        mut handler := os.create('test.txt') or { panic(err) }
        defer {
                handler.close()        
        }

        handler.write_string('Hello World!') or { panic(err) }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment