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.

  • Patterns in the Archive

    To help him check his Google Drive files with three different pattern matchers, Mike builds a command-line tool in Go to maintain a meta cache.

  • 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.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News