Leanpub Header

Skip to main content

From Ruby to Golang

A Ruby Programmer's Guide to Learning Go

By teaching familiar implementations found in Ruby, you will see the correlation between the two languages, establishing familiar concepts to give you enough knowledge to be comfortable with Go and to start programming with it.

Minimum price

$20.00

$30.00

You pay

$30.00

Author earns

$24.00
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
About

About

About the Book

Imagine that you like to learn a new programming language, and you start by leveraging what you already know and bridge the gap in learning specific parts of the new language. This book was created on that idea, it starts with using my existing language knowledge and experience to breakdown Go into familiar Ruby concepts and implementations.

By teaching familiar implementations found in Ruby, you will see the correlation between the two languages, establishing familiar concepts to give you enough knowledge to be comfortable with Go and to start programming with it.

In today's world of cloud native microservices, containerized architectures, You can be up-to-date with a knowledge in Go. Many notable open-source projects are built using Go (i.e. Docker, Kubernetes, Ethereum and Terraform to name a few), and those platforms have APIs and SDKs readily available natively for you to use. And many global companies have been using Go in production (i.e. Google, Netflix, Dropbox, Heroku and Uber to name a few), proving that it has been battle-tested and powerful mature language to based your work into.

This book was made with a Rubyist in mind, all the learning metaphors are based on Ruby and I think it will help you to learn Go programming language when you already knows Ruby. Go can be your second or third programming language and this book can help you get started.

Author

About the Author

Joel Bryan Juliano

Hi, I'm Joel.

I am Senior Software Engineer with 20+ years of experience.

And with over 20 years in the game, I’ve seen it all and loved every minute of it.

Originally from the Philippines, I am now a Dutchman living in Amsterdam together with my family.

My journey has taken me through a variety of industries, from sports streaming to cybersecurity, and everything in between.

Along the way, I’ve picked up a diverse set of skills and experiences, in which I document into books.

Contents

Table of Contents

Preface

Introduction

  1. About the Author

Chapter 0: Go Primer

  1. Package Name and Imports
  2. Println
  3. Printf
  4. Sprintf
  5. Functions
  6. Function Basics
  7. Function Parameters and Arguments
  8. Function Return Types
  9. Main Function

Chapter 1: Structs

  1. Instance Variables
  2. Struct
  3. Public Structs
  4. Attaching a Struct to a Function
  5. Pass-by-value and Pass-by-reference
  6. Pointer Receiver
  7. Value Receiver
  8. Decouple and Reuse Structs through Inheritance
  9. Anonymous Structs
  10. Anonymous Struct Fields
  11. Chapter Questions

Chapter 2: Maps

  1. Maps by Declaration
  2. Initialization by Make
  3. Initialization by Literal Type Assignment
  4. Maps by Assignment
  5. Assignment with a Key/Value
  6. Assignment on an Empty Map
  7. Using Struct in Maps
  8. Struct Maps by Declaration
  9. Struct Maps by Assignment
  10. Struct Maps with Array Values
  11. Maps with Dynamic Types
  12. Deleting Map Values
  13. Reading a Non-Present Key from a Map
  14. Variadic Functions
  15. Variadic Interface
  16. Maps with Variadic Interface
  17. Chapter Questions

Chapter 3: Arrays and Slices

  1. Fixed Array
  2. Fixed-Array Automatic Size Calculation
  3. Fixed-Array Sizes
  4. Fixed-Array Assignment Behaviour
  5. Sliced Array
  6. Sliced-Array Assignment Behaviour
  7. Capacity
  8. Deep Copy
  9. Append
  10. Arrays with Variadic Types
  11. Empty Interface Array Type
  12. Chapter Questions

Chapter 4: Array Navigation

  1. C-style Semantic Form
  2. Value Semantic Form
  3. Value Semantic Form with Muted Parameter
  4. Index Semantic Form for Range
  5. Value Semantic Form with Pointer Access
  6. Chapter Questions

Chapter 5: Package Management

  1. Sharing Go Packages
  2. Package Management using Go Modules
  3. Manual go.mod Generation
  4. Automatic go.mod Generation Through Source-Code
  5. Automatic go.mod Generation Through dep Package Manager
  6. Refresh Go Modules
  7. Package Management using Dep
  8. Chapter Questions

Chapter 6: Collection Functions

  1. Predicate Method all?
  2. Predicate Method any?
  3. Collect Enumerable Method
  4. Cycle Enumerable Method
  5. Detect Enumerable Method
  6. Drop Enumerable Method
  7. Drop While Enumerable Method
  8. Chapter Questions

Chapter 7: Interfaces

  1. Interface as a Self-Documenting API Reference
  2. Interface as Type contract
  3. Satisfying Return Values
  4. Chapter Questions

Glossary

Acknowledgments

Credits

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub