Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by NateDad

11 years ago

Use io.Copy to copy from the file to os.Stdout. no need to read the whole thing into memory.

2 comments

NateDad

Reply

barsonme  11 years ago

Hadn't even thought of that! Nice catch. It's even shorter: https://gist.github.com/EricLagerg/c3ccf96f6ed90d8b4557

  • EugeneOZ  11 years ago

    Stop it please, or PHP will win this race easily. With just 1 line of code. And it doesn't mean anything.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities