Best resources to learn Go programming language!!

Golang aka go programming language is the fastest-growing programming most loved programming language.

If you think you are not used ” go ” directly or indirectly then I think you are wrong. Have you heard about Docker containerization technology then you are indirectly using Go language in your day to day basis.

Docker is written in the Google Go programming language.

What is GoLang?

Go-Lang is an open-source language officially released by the Google production team in 2009. It was developed by Robert Griesemer, Ken Thompson and Rob Pike. It is a multi-purpose programming language specially designed to build faster and scalable applications. It provides features like fast compilation, garbage collection, dynamic types, concurrency, standard libraries, and packages.

Let us take a tour to understand what are the best resources available to get started this programming language.

1. Go Tour:-  

This is my favorite site to get started and make our hands dirty. This is the official Go Tour website: https://tour.golang.org. The best things about this site are that the tour is available offline just by running go tool tour in your command line if you have already installed Go-lang locally. This is providing an interactive tutorial where you can run your code snippet and it gives you an overview of Go-Lang. The tour is classified into different sets of modules.

2. Go By Example:- 

Another effective to start go-lang learning is going by example. Go by Example is an interactive online course tutorial for learning Go. Once you know the basic then go ahead and hit the Go by example (https://gobyexample.com). Start hacking by taking examples and get moderate knowledge about go-lang. 

3. Effective Go:-

This is another official resource to learn go-lang. This is also available for free. This is a very interesting website https://golang.org/doc/effective_go.html to explore more about the go-lang. I found it very useful especially because is not just a syntax reference document but a more complete description of all the Go features and constructs and how to use them effectively. This is where you will get some level of expertise.

4.Golangbootcamp:-

Golang Bootcamp is a mini book to start learning go-lang. How to get started on Go? Hit this URL http://www.golangbootcamp.com/book/ to explore this book. This book will open a window for you to start learning effectively go-lang. The best thing about this mini-book is, it has a list of basic constructs and concepts and all those attached with go-lang playground. 

5. Go-Playground:- 

Now you know basic of go-lang language and you know how to construct the things. you no need to install go-lang locally on your system to start. We have online https://play.golang.org/ go-lang playground to test your knowledge and constructs. 

6. Go-Lang FAQ:-

Go-lang FAQ is really golden gate for you to understand the core concept and clarify your Bigbang doubts. This is also an official website https://golang.org/doc/faq.

7. Go-lang Bot:-

Golangbot is a fun and easy way to follow and learn Golang consistently and regularly. This can help you in improving your coding, solving practical issues, basics of Golang to advanced tutorials. This is inclusive of all learning materials of Golang. here you will get a different experience of learning. 

Hit this URL to go https://golangbot.com/ and start with hello world to a complex program and Quizs too.  

8. Tutorials Point:-

The tutorials point is also one of the best resources to get familiar with go-lang. if you are an avid reader and learner you should know tutorials point. 

https://www.tutorialspoint.com/go/.

9. Go-Lang Tutorials:-

GoLang tutorials is the best free online classes to learn go-lang. These classes best suited for professionals as well as beginners. It has a cover of the basic concept, control flow, looping, interfaces, memory management, etc. Tutorials are classifieds into sections and all sections having examples.Table of Contents
Audience Installing and configuring Go A step by step approach to Hello World in Go Updated for Go1 Typical early…golangtutorials.blogspot.com

10. Reference Books:-

  1. Introducing Go by O’Reilly.
  2. Go in Action.
  3. Learning Functional Programming in Go.

Conclusion:-

These are my findings. Please let us know your resources to learn go-lang. How you started and what are the other resources do you think are better to start learning go-lang.

Github Package Registry

Ship your software like a Pro!!!

For more stories

Github recently announced Github package registry to publish and consume packages over GitHub. One-stop solution for all open source project.

Why Github Package Registry?

GitHub Package Registry is a software package hosting service, similar to npmjs.org, rubygems.org, or hub.docker.com, that allows you to host your packages and code in one place. You can host software packages privately or publicly and use them as dependencies in your projects.

Over the last decade, we are using Github to maintain open-source projects. There are millions of public and private repositories are there on GitHub. Software development is a collaborative activity its teamwork. Irrespective of a language we have to publish that source code as a bundle so any other user can consume it as a dependency to do this we are always relying on different registry such as maven, Gradle, npm, and docker, etc. You can manage source code as well as your different package under one umbrella.

Github is committed to serving developers and given them different tools to improve the developer experience.

It’s your code, your packages, and one login.

Some developer did collaboration in open source either way either they will commit the code in some repository or they will import open source packages into there project. This is very critical to find out the open source packages that we can trust and import in the dependency graph. We need someone on whom we can rely on for a trust. Like while using open source packages we are always considering different aspects such as trust, community, support in terms of new features or in terms of compliance.

Github package Registry Goals:-

Github package registry launched with three main goals.

  1. Sharing:- You can share and manage your packages the way you are managing your code
  2. Productivity:- Improve your productivity, while managing software development lifecycle.
  3. Trust:– Develop, maintain and store your packages in the same secure environment with a single login.

Features:-

“A picture is worth a thousand words

GitHub Package Registry is free for all repositories during the beta. And it will always be free for public and open source repositories.

To explore more please refer to this link.

Managing packages with GitHub Package Registry – GitHub HelpConfiguring Docker for use with GitHub Package Registryhelp.github.com

De-obfuscate stack traces!!?

De-obfuscate stack traces!!?

For more stories.

Enabling Proguard for android In this article I had told How to obfuscate the code. If you don’t know How obfuscate the code, not data be clear? Proguard is obfuscating the code.

A good engineer thinks in reverse and asks himself about the stylistic consequences of the components and systems he proposes. — — Helmut Jahn

When we obfuscate the code the class names and method names are converted into some random obfuscated names such as a,b,c, etc. The problem is encounter when some exception raised or application is crashed How to decode that stack trace that is the big question developer having.

Exception, errors and Bugs are fact of developers life. So many developers requested and asked me How to de-obfuscate the stack trace? I answered couple of developers but any email you’ve written twice should be a blog post.

where there is a will there is a way.

Once proguard shrinks your code, reading obfuscated stack trace is difficult because filed, method and class names are obfuscated. Fortunately to help developers Proguard provide you mapping file. Every time you run and obfuscate the code, proguard is generating a mapping.txt file.

ProGuard outputs the following files:

dump.txt:- Describes the internal structure of all the class files in the APK.

mapping.txt:- Provides a translation between the original and obfuscated class, method, and field names.

seeds.txt:- Lists the classes and members that were not obfuscated.

usage.txt:- Lists the code that was removed from the APK.

These files are saved at <module-name>/build/outputs/mapping/release/

Mapping.txt file ? :

Mapping file is just simple text file which contains original field, method, and class names mapped to the obfuscated names. You will locate this file at below path app <modulename>/build/outputs/mapping/release/mapping.txt directory.

Note :– Each time you run to create a release build with ProGuard mapping.txt file is overwritten. So retain the mapping.txt file for every version, better keep the mapping.txt file along with the code.

Command to de-obfuscation

retrace.bat|retrace.sh [-verbose] mapping.txt [<stacktrace_file>]

for e.g

retrace.bat -verbose mapping.txt obfuscated_stack_trace.txt

Sample mapping.txt file

com.apothesource.hidingpasswords.HidingUtil -> com.apothesource.hidingpasswords.a: java.lang.String hide(java.lang.String) -> a java.lang.String unhide(java.lang.String) -> b void doHiding(byte[],byte[],boolean) -> acom.apothesource.hidingpasswords.MainActivity -> com.apothesource.hidingpasswords.MainActivity: byte[] mySlightlyCleverHidingKey -> a java.lang.String[] myCompositeKey -> b void onCreate(android.os.Bundle) -> onCreate boolean onCreateOptionsMenu(android.view.Menu) -> onCreateOptionsMenu boolean onOptionsItemSelected(android.view.MenuItem) -> onOptionsItemSelected

How to use it in Production?

In every developer everything is working perfectly on local but not on production.

While uploading APK file on play store you can upload the mapping.txt file.

Important Not from Google:- Once you’ve uploaded a mapping file for a version of your app, only future crashes for that version of your app will be deobfuscated. Crashes for a version of your app that happen before you’ve uploaded its respective mapping file won’t be deobfuscated.

  1. Sign in to your Play Console.
  2. Select your app.
  3. From the left menu, click Android vitals > Deobfuscation files.
  4. Next, to a version of your app, click Upload to upload mapping.txt file.
  5. Upload the ProGuard mapping.txt file for the version of your app.

Once everything works fine then go and Select a crash & ANR and On the ‘Stack Traces’ tab, you’ll see your deobfuscated stack traces.

You can achieve the same thing with the help of developer API as well, details are here.

Reference links:-

https://developer.android.com/studio/build/shrink-code

https://www.guardsquare.com/en/proguard/manual/retrace

Let me know your way to de-obfuscate the stack trace.

For more stories.

Lets connect on Stackoverflow , LinkedIn , Facebook& Twitter.