Go.Tips
12 subscribers
7 photos
16 links
Useful tips, libraries and information for Go (Golang) developers

Rust::Tips: @rust_code_tips
My GitHub: https://github.com/ankddev
Download Telegram
About this channel
In this channel I will publish useful libraries, tips, quizzes and other information for Go developers.

My GitHub: https://github.com/ankddev

Channel link: https://t.me/golang_tips

My other channels:
- Rust::Tips - @rust_code_tips - about Rust language

Official Go Discord server: https://discord.com/invite/golang

Hashtags:
#tip - useful tip about language or it's tools
#code - code example
#program - project, wrote on Go
#library - useful library
#resource - useful resource about language
#idiomatic - idiomatic code and patterns
#book - book about Go or it's tools/projects
#fact - interesting or fun fact about Go
#goroutins - related to goroutins
#errors - error handling
#advanced - advanced topics
#project and #showcase - projects written in Go
#news - Go-related news
...and some other hashtags about specific topic!
bot
A Go zero-dependencies telegram bot framework.

Simple echo example:
package main

import (
"context"
"os"
"os/signal"

"github.com/go-telegram/bot"
"github.com/go-telegram/bot/models"
)

// Send any text message to the bot after the bot has been started

func main() {
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
defer cancel()

opts := []bot.Option{
bot.WithDefaultHandler(handler),
}

b, err := bot.New("YOUR_BOT_TOKEN_FROM_BOTFATHER", opts...)
if err != nil {
panic(err)
}

b.Start(ctx)
}

func handler(ctx context.Context, b *bot.Bot, update *models.Update) {
b.SendMessage(ctx, &bot.SendMessageParams{
ChatID: update.Message.Chat.ID,
Text: update.Message.Text,
})
}

GitHub
#library #telegram
@golang_tips
Bubble Tea
The fun, functional and stateful way to build terminal apps. A Go framework based on The Elm Architecture. Bubble Tea is well-suited for simple and complex terminal applications, either inline, full-window, or a mix of both.
GitHub
#library #tui #gui
@golang_tips
Cobra
Cobra is a library for creating powerful modern CLI applications.
Cobra is used in many Go projects such as KubernetesHugo, and GitHub CLI to name a few.
Features:
- Easy subcommand-based CLIs: app server, app fetch, etc.
- Fully POSIX-compliant flags (including short & long versions)
- Nested subcommands
- Global, local and cascading flags
Intelligent suggestions (app srver... did you mean app server?)
- Automatic help generation for commands and flags
- Grouping help for subcommands
Automatic help flag recognition of -h, --help, etc.
- Automatically generated shell autocomplete for your application (bash, zsh, fish, powershell)
- Automatically generated man pages for your application
- Command aliases so you can change things without breaking them
- The flexibility to define your own help, usage, etc.
- Optional seamless integration with viper for 12-factor apps
GitHub
Website
#library #project #showcase #cli
@golang_tips