From Bash to Golang: Elevate Your Terminal Experience with Tview

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024
  • The DeFacto Golang Book - amzn.to/3Ytywpg
    My Code - github.com/dev...
    Tview Library - github.com/riv...
    All my links - linktr.ee/devhulk
    Learn how to create a user interface for your terminal using Golang. This Golang tutorial will show you how to create a simple user interface that allows you to easily navigate your terminal.
    If you're looking for a way to increase the usability of your terminal, then this Golang tutorial is for you! By learning how to create a user interface in Golang, you'll be able to easily navigate your terminal and get the most out of your Golang development experience.

Комментарии • 27

  • @wernerxldata
    @wernerxldata 11 месяцев назад +3

    These days I don't build a lot of 'menu' based bash scripts anymore. Most of them are executed from other tools with already chosen parameters. Sometimes it get's for example just a job id and fetched extra metadata from a database or rest api, yes you can do stuff like that with bash as well ;)
    Seperation of functions in a library in separated files is a step forward too, you don't need to put everything in one file, build nice generic functions and 'source' the files you need in your new script, just as you do with imports in Go.
    The harder parts are stuff like return values from functions, so you can move on from the 'everything is global' to a more localized way of working. In the past years I figured out ways to fix those issues. Problem is you have to force yourself into a way of working, the language itself doesn't do that for you. No baby sitter available in Bash 😂
    But I'm with you, I'm spending more time in Go and Python these days, makes a lot of work easier. But the mix of it can be quite powerfull, business logic in a more modern language and just simple task execution in bash.

    • @devhulk
      @devhulk  11 месяцев назад

      Valid. I can’t say that I’ve ever built a bash menu for anything work related. That’s really why I did it in the first place lol. It’s fun to see the contrast between two approaches.

    • @wernerxldata
      @wernerxldata 11 месяцев назад

      @@devhulk At the moment I'm using php a lot for writing devops scripts, it integrates well with a lot of linux cli stuff, can do databases easily, all kinds of key value stores, rest api's, it supports anything you can think of and most of it in core packages (so just package manager installable modules), so no hassle with dependency drama. It has good template engines so creating configuration files from templates is easy. And you can actually program readable stuff there with good error handling, you have the choice for procedural vs oo or a combination, not too much abstraction in it unless you create it yourself.
      Wouldn't choose it for other projects but it works really nicely here. We tried Python combined with ansible for a while, not really my cup of tea, especially the ansible way of working. Python in itself is fine however it doesn't work as easily as php does. The latter gives you a lot of room for doing it your way.

  • @sahil6621
    @sahil6621 4 месяца назад +2

    Have you explored bubble tea , also a tui framework

    • @devhulk
      @devhulk  4 месяца назад

      I haven't but will have to check it out!

  • @davidrieger3160
    @davidrieger3160 Год назад +2

    Cool video. That library looks neat as well.

    • @devhulk
      @devhulk  Год назад

      Thank you! Was a fun one to make.

  • @VrashabhSontakke
    @VrashabhSontakke Год назад +2

    golang keeps getting exciting 🎉

  • @mgd8867
    @mgd8867 3 месяца назад

    Great vid! Imagine my depression when I started a new job and we weren't allowed to use Golang for any production use cases.

    • @devhulk
      @devhulk  3 месяца назад

      Thanks! And that sucks, why? They just want to consolidate to one stack or? I'm always curious why different companies make these sorts of decisions.

    • @mgd8867
      @mgd8867 3 месяца назад

      @@devhulk they haven't got the security scanning setup and they see it as a risk!

    • @devhulk
      @devhulk  3 месяца назад

      @@mgd8867 seems like a simple problem lol oh well 🤷‍♂️ 😂

  • @wilk85
    @wilk85 4 месяца назад

    Finally found someone who is also devops, and using bash and want to move to go :)

    • @devhulk
      @devhulk  4 месяца назад

      Hello brethren :)

    • @wilk85
      @wilk85 4 месяца назад

      Hej man :) will you be creating some more stuff with bash go?

  • @anwiseru9064
    @anwiseru9064 10 месяцев назад

    i like your video editing

    • @devhulk
      @devhulk  9 месяцев назад

      Thank you 🙏

  • @etfstrategy-vb2eo
    @etfstrategy-vb2eo Год назад +1

    bash rocks!

    • @devhulk
      @devhulk  Год назад

      📠

    • @wernerxldata
      @wernerxldata 11 месяцев назад +1

      I agree, it's a really sharp tool in the toolbox but not meant for everything. But you can do more with it than most people know.
      As with any language it's more efficient if you build/get yourself a library of reusable code.
      Everyone starting with bash hates it first, , it is quirky sometimes, later on it's something you can not do without anymore. Especially the oneliners are quite fun 😇

  • @uidx-bob
    @uidx-bob 9 месяцев назад

    Go wins and you didn’t even have unit testing as a criteria. With unit tests added I wonder how nasty that simple bash script becomes.

    • @devhulk
      @devhulk  9 месяцев назад +1

      The thought of Unit Testing in bash feels like a fever dream lol

  • @Skaiiur
    @Skaiiur Месяц назад

    Lack of tmux is going on

    • @devhulk
      @devhulk  Месяц назад

      Yea, I like tmux but iterm does good enough 90% of the time unless I'm remoting into a machine. When I context switch to "devops" work tmux pops into my workflow much more.

  • @Carrion-Crow
    @Carrion-Crow 2 месяца назад

    Даже тут го гавно. Баш скрипт куда проще будет прочитать и понять чем вот эти кучи хитросплетений GO