Adapt the PDFtk PDF tool's call syntax with Go

Fast or Maintainable

Granted, parts of the Go program I looked at today would have been easier to write as shell scripts. For many routine tasks, a shell hack is practical and often fine for the job at hand. But as the task becomes more challenging – for example, when performing calculations like determining the longest substring from an array – scripts quickly become unwieldy and hard to read. This is where Go benefits from better maintainability, even if the initial overhead is considerably greater.

The Author

Mike Schilli works as a software engineer in the San Francisco Bay area, California. Each month in his column, which has been running since 1997, he researches practical applications of various programming languages. If you email him at mailto:mschilli@perlmeister.com he will gladly answer any questions.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • PDF Toolkit

    To manage the mountains of paper that cross our desks every day, we need to file, retrieve, copy, stamp, investigate, and classify documents. A special tool can help users keep on top of their electronic paperwork: pdftk – the PDF toolkit.

  • Perl – Tagging e-Books in Evernote

    Google Drive lacks a mechanism for tagging files, so we look at two APIs that scripts can use to store metadata on Evernote, allowing searches of e-books by category or property.

  • Command Line: make

    Developers, LaTeX users, and system administrators can all harness the power of make.

  • Programming Snapshot – Bulk Renaming

    Renaming multiple files following a pattern often requires small shell scripts. Mike Schilli looks to simplify this task with a Go program.

  • Sweet Dreams

    Bathtub singer Mike Schilli builds a Go tool that manages song lyrics from YAML files and helps him learn them by heart, line by line.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95

News