powerful_command-line_applications_in_go_preface

Powerful Command-Line Applications in Go Preface

Return to Powerful Command-Line Applications in Go, Golang Command-Line Applications, Golang, Golang Bibliography, Golang Courses, Golang DevOps - Golang CI/CD, Golang Security - Golang DevSecOps, Golang Functional Programming, Golang Concurrency, Golang Data Science - Golang and Databases, Golang Machine Learning, Golang Glossary, Awesome Golang, Golang GitHub, Golang Topics

Fair Use Source: B09RTRST6T (PwCLappGo 2022)

“ (PwCLappGo 2022)

Foreword

In 2012 I began a journey of experimentation in investigating a new language, Go, which was born at Google and had just reached the 1.0 milestone. I learn best by building so I was looking for a project meaningful enough to actually learn Go. I was growing frustrated with the increasing cost and complexity of my WordPress-powered blog with entirely static content and decided that building a static site generator was the project for me to learn Go. I began writing my first Go project, Hugo[1].

Having previously designed several CMSs and command-line tools, I had a good sense of what I wanted to build. I opened up a terminal and began by typing commands for this not yet existing program to effectively sketch out how the user interface would be shaped. With this sketch in hand, I then began the process of building the application. As I was inexperienced with Go, I hoped to lean heavily on existing libraries, but as this was the dawn of the Go ecosystem, more often than not, the libraries I needed didn’t exist.

Unable to find the right library to support the design pattern of application command flag argument, I set out to write it myself. I also needed config file management as there was too much configurability to anticipate everything passed via the command line. As my goal was building Hugo, these were just Hugo packages initially, but I thought maybe someone else would benefit from this functionality too, and I pulled them out into standalone libraries and named them Cobra[2] and Viper[3], featured in Chapter 7, ​Using the Cobra CLI Framework​ of this book.

Through the experience of building Hugo, Cobra, and Viper, I had a revelation: while Go was initially targeted at large-scale server applications, the Go creators had developed a language perfectly suited for command-line tools. It had everything you needed and most of what you wanted:

Go had nearly all the advantages of a dynamic language during development and all the advantages of a compiled language during execution, plus additional unique advantages. In short, Go is uniquely perfect for both building and running command-line applications.

At the time, I was leading product, client engineering, customer engineering, and developer relations for MongoDB. I eralized that if we had written our CLI applications in Go, our support ticket volume would drop by more than half as the majority of issues users experienced were due to complications with runtime and library incompatibilities present in the Java and Python ecosystems we were then using, and the same would be true for .Net, Ruby, JavaScript, and other popular languages. Due to Go’s focus on security and type safety, we would end up with far fewer issues to debug. We learned that in addition to these benefits, we also had happier, more productive developers writing Go.

Sometimes in life, the smallest things have a profound impact. This experiment I began in 2012 with this new language led to:

MongoDB being one of Go’s earliest adopters, which in part contributed to its massive success as one of the most valuable open source companies ever.

My speaking at the first Gophercon, which led to several other speaking opportunities and established relationships that eventually led to me joining and co-leading the Go team at Google.

Hugo growing to become the most popular static site generator in terms of number of public websites and in terms of GitHub stars with notable users such as Brave.com, LetsEncrypt.org, SmashingMagazine.com, and Digital.gov.

Building CLIs in Go, which is the second most popular use for Go with 65% of Go developers writing CLIs.

Cobra becoming the CLI framework for Go with virtually all major Go applications using it including Kubernetes, Docker and GitHub CLI.

Through this, I’ve also had the good fortune of getting to know Ricardo Gerardi, who has also been on a profound journey, which you will read about in the preface. Part of Ricardo’s journey has been learning Go and discovering its power for creating CLI applications. Ricardo poured his experience into writing this excellent book on getting started with command-line applications in Go. It does a beautiful job of starting with basic concepts and slowly building on them with just the right balance of explanation so you can understand what is really happening. It takes the reader on a journey from building very small single-purpose tools to full-fledged command-line applications. Working through the book, I was able to relive the excitement I experienced a decade ago learning Go. This is a book that is best experienced alongside an editor and console.

I now invite you to start your own journey of experimentation. Along the way, you’ll learn all you need to know about working with Go and designing command-line applications. You’ll learn the basic techniques and libraries used to build applications like Go itself, Hugo, Docker, and Kubernetes. Most importantly, you’ll discover the joy of programming. You’ll be amazed at the new superpower you’ve developed—the ability to create applications that work exactly like you need them to. This book is your guide to unlocking your new superpowers. Enjoy the journey.

Steve Francia

Author of Cobra, Viper, and Hugo, and the Go Product Lead at Google

FOOTNOTES

[1] https://gohugo.io

[2] https://github.com/spf13/cobra

[3] https://github.com/spf13/viper

Fair Use Sources

SHORTEN THIS to 20 ITEMS! navbar_golang

Golang: Golang Fundamentals, Golang Inventor - Golang Language Designer: Ken Thompson, Robert Griesemer, Rob Pike of Google, Go abstraction, Go agile, Go ahead-of-time (AOT), Go AI, Go algebraic data types, Go algorithms, Go Android, Go anonymous functions, Go AOP, Go AOT, Go APIs, Go arguments, Go ARM, Go arithmetic, Go arrays, Go aspect-oriented, Go assignment, Go associative arrays, Go async, Go asynchronous callbacks, Go asynchronous programming, Go automatic variables, Go automation, Go Avro, Go backend, Go backwards compatibility, Go block scoped, Go Booleans, Go Boolean expressions, Go buffer overflow, Go builds, Go built-in types, Go bytecode, Go cache, Go caching, Go call by reference, Go call by value, Go callbacks, Go call stack, Go casting, Go characters, Go Chocolatey, Go CI/CD, Go classes, Go CLI, Go client-side, Go closures, Go cloud (Go Cloud Native-Go AWS-Go Azure-Go GCP-Go IBM Cloud-Go IBM Mainframe-Go OCI), Go code smells, Go coercion, Go collections, Go command-line interface, Go commands, Go comments, Go compilers, Go complex numbers, Go composition, Go configuration, Go concurrency, Go concurrent programming, Go conditional expressions, Go conferences, Go constants, Go constructors, Go containers, Go control flow, Go control structures, Go coroutines, Go crashes, Go creators, Go currying, Go databases, Go data manipulation, Go data persistence, Go data science, Go data serialization, Go Built-In Data Types, Go data structures, Go data synchronization, Go dates, Go dates and times, Go deadlocks, Go debugging, Go declarative, Go deferred callbacks, Go delegates, Go delegation, Go dependency injection, Go design patterns, Go designers, Go destructors, Go DevOps, Go dictionaries, Go dictionary comprehensions, Go DI, Go distributed software, Go distributions, Go distros, Go DL, Go Docker, Go do-while, Go DSL, Go duck typing, Go dynamic binding, Go dynamic scope, Go dynamically scoped, Go dynamically typed, Go dynamic variables, Go eager evaluation, Go embedded, Go encapsulation, Go encryption, Go enumerated types, Go enumeration, Go enums, Go environment variables, Go errors, Go error handling, Go evaluation strategy, Go event-driven, Go event handlers, Go event loops, Go exception handling, Go executables, Go execution, Go expressions, Go FaaS, Go Facebook, Go fibers, Go fields, Go file input/output, Go file synchronization, Go file I/O, Go filter, Go first-class functions, Go fold, Go foreach loops, Go fork-join, Go floating-point, Go FP, Go frameworks, Go FreeBSD, Go frontend, Go functions, Go functional, Go functional programming, Go function overloading, Go garbage collection, Go generators, Go generator expressions, Go generics, Go generic programming, Go GitHub, Go global variables, Go GraphQL, Go gRPC, Go GUI, Go hashing, Go heap, Go heap allocation, Go hello world, Go higher-order functions, Go history, Go Homebrew, Go HTTP, Go idempotence, Go IDEs, Go import, Go imperative, Go immutable values, Go immutability, Go inheritance, Go influenced, Go influenced by, Go installation, Go integers, Go integration testing, Go interfaces, Go internationalization, Go interpreters, Go interprocess communication (IPC), Go iOS, Go IoT, Go IPCs, Go ISO Standard, Go iteration, Go JetBrains, Go JIT, Go JSON, Go JSON-RPC, Go JSON Web Tokens, Go JSON Web Token (JWT), Go Just-in-time (JIT), Go JWT, Go K8S, Go keywords, Go lambdas, Go language spec, Go lazy evaluation, Go lexically scoped, Go lexical scoping, Go libraries, Go linters, Go Linux, Go lists, Go list comprehensions, Go literals, Go localization, Go local variables, Go locks, Go logging, Go logo, Go looping, Go macOS, Go map, Go mascot, Go math, Go member variables, Go memoization, Go memory addressing, Go memory allocation, Go malloc, Go memory management, Go memory safety, Go message queues, Go metaclasses, Go meta-programming, Go methods, Go method overloading, Go MFA, Go ML, Go microservices, Go Microsoft, Go mobile dev, Go modules, Go modulo operators, Go monitoring, Go multiprocessing, Go multi-threaded, Go mutable values, Go mutability, Go mutex (Go mutual exclusion), Go namespaces, Go natural language processing (NLP), Go networking, Go network programming, Go NLP, Go non-blocking, Go non-blocking I/O, Go null, Go null reference, Go null coalescing operators, Go numbers, Go number precision, Go OAuth, Go objects, Go object code, Go object comparisons, Go object creation, Go object creators, Go object destruction, Go object destructors, Go object lifetime, Go object-oriented constructors, Go object-oriented programming, Go object serialization, Go observability, Go OOP, Go operators, Go operator overloading, Go optimizations, Go organizations, Go ORMs, Go packages, Go package managers, Go pass by reference, Go pass by value, Go parallel computing, Go parallel programming, Go parallelism, Go parameters, Go people, Go performance, Go persistence, Go pipelines, Go pointers, Go polymorphism, Go primitives, Go primitive data types, Go probability, Go procedural, Go processes, Go producer-consumer, Go programmers, Go programming, Go programming paradigm, Go program structure, Go program termination, Go Protocol Buffers (Protobuf), Go Protocol Buffers, Go Protobuf, Go proxies, Go public-key encryption, Go PKI, Go pure functions, Go race conditions, Go random, Go reactive, Go readability, Go records, Go recursion, Go reentrancy, Go refactoring, Go reference counting, Go reference types, Go referential transparency, Go reflection, Go regex, Go remote procedure calls (RPC), Go REPL, Go reserved words, Go REST, Go REST APIs, Go RHEL, Go RPCs, Go runtimes, Go safe navigation operators, Go SDK, Go secrets, Go security, Go serialization, Go serverless, Go server-side, Go sets, Go set comprehensions, Go side effects, Go signed integers, Go SMTP, Go Snapcraft, Go social media, Go sockets, Go source code, Go source-to-source compiler, Go SQL, Go SSL - Go SSL-TLS, Go Single sign-on (SSO), Go SSO, Go StackOverflow, Go stack, Go stack allocation, Go Stack overflow, Go standards, Go standard errors, Go standard input, Go standard library, Go standard operators, Go standard output, Go state, Go statements, Go strings, Go string concatenation, Go string functions, Go string operations, Go scheduling, Go scientific notation, Go scope, Go scope rules, Go scoping, Go scripting, Go static analyzers, Go statically scoped, Go static scoping, Go statically typed, Go static variables, Go statistics, Go strongly typed, Go structural typing, Go synchronization, Go syntax, Go systems programming, Go TCP/IP, Go TDD, Go testing, Go test frameworks, Go threads, Go thread-local storage (TLS), Go TLS, Go thread locking, Go thread locks, Go thread safety, Go thread scheduling, Go thread synchronization, Go times, Go timers, Go to JavaScript, Go tools, Go toolchain, Go transpiler, Go transpiling to JavaScript, Go truth values, Go tuples, Go type checking, Go type conversion, Go type inference, Go type safety, Go type system, Go web dev, Go while loops, Go work stealing, Go values, Go value types, Go variables, Go variable lifetime, Go variable scope, Go versions, Go virtual environments, Go virtual machine, Go Ubuntu, Go Unicode, Go unit testing, Go unsigned integers, Go usability, Go weakly typed, Go Windows, Go wrappers, Go written using, Go x86-64-Go AMD64, Go XML, Go YAML, Go Awesome list;

Go topics-Go courses-Go books-Go docs. (navbar_golang and navbar_golang_detailed)

navbar_programming and navbar_programming_detailed


© 1994 - 2024 Cloud Monk Losang Jinpa or Fair Use. Disclaimers

SYI LU SENG E MU CHYWE YE. NAN. WEI LA YE. WEI LA YE. SA WA HE.


powerful_command-line_applications_in_go_preface.txt · Last modified: 2024/04/28 03:39 (external edit)