justforfunc #19: mastering io.Pipes

Поделиться
HTML-код
  • Опубликовано: 24 дек 2024

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

  • @JustForFunc
    @JustForFunc  7 лет назад +6

    It turns out I can't add links to the the video from this video ... which is sad, but if you wanted to skip the io.Pipe basics and go into the iterm2 imgcat program it's 11:45

  • @luizfelipemartino6804
    @luizfelipemartino6804 7 лет назад +7

    Hey Francesc, thank you for those videos man, I really like it.
    I'd like suggest you talk a bit about architecture, I know it's a bit subjective but We've got lots of design patterns and stuff for OO and since go has a sort of new paradigm would be nice to learn a bit more about it

  • @abiiranathan
    @abiiranathan 3 года назад

    Am your biggest fan. Your videos are very educational, fun and to the point. I wish you a million subs and beyond

  • @yann3658
    @yann3658 7 лет назад +2

    Nice video ! For this kind of complex things, maybe you can provide some visuals of what's in, what's out and interactions with pipes? Thank you, I really like your videos !

  • @Ojee2
    @Ojee2 7 лет назад +8

    The intro made me smile :)

  • @leonklingele
    @leonklingele 7 лет назад +2

    Where does the trailing % @ 8:58 come from? I've seen that one before but never really understood why it happens.

    • @leonklingele
      @leonklingele 7 лет назад +3

      Oh, nvm, it's because I was testing it in bash. The shell you're using - zsh - seems to automatically append a percent sign (%) to denote the end of a partial line (if it does not end in "
      "). unix.stackexchange.com/questions/167582/why-zsh-ends-a-line-with-a-highlighted-percent-symbol Guess I need to use zsh more often.

  • @silence1598
    @silence1598 7 лет назад +1

    Thank you for interesting introduction to io.Pipes.

  • @ucheumeh7357
    @ucheumeh7357 4 года назад

    Great tutorial on io.Pipes!!!

  • @Shan-fx5wv
    @Shan-fx5wv 3 года назад

    How to create a named pipe and write a content to it?

  • @shamim520778774
    @shamim520778774 6 лет назад

    Your sessions are all mind blowing

  • @saadazzz
    @saadazzz 7 лет назад

    Hey Francesc. Thanks for the instructional video. I have a question. How do you do async I/O in Go? All of these examples seem synchronous? Would I have to use channels instead of pipes?

  • @Shan-fx5wv
    @Shan-fx5wv 3 года назад

    Syscall.Mkfifo is not getting imported

  • @AlbertoRestifo
    @AlbertoRestifo 7 лет назад

    Amazing and instructive as always Francisco!
    I have one question: in the imgcat package, you defined the `writer` struct as an unexported variable, despite the fact that is returned by an exported method.
    Why does this work?

    • @JustForFunc
      @JustForFunc  7 лет назад +4

      +Alberto Restifo first things first: my name is Francesc
      I define an exported type, but I return an exported interface (io.WriteCloser). You could technically return the unexported type too, but that's just a bad idea

  • @kitgary
    @kitgary 7 лет назад

    So cool! I made similar mistakes, I even don't know that is wrong.

  • @LucasVieira42
    @LucasVieira42 7 лет назад +2

    This blew my mind \o/

  • @BryanChance
    @BryanChance 2 года назад

    OMG, i thought C is convoluted. LOL And all the err err err err err. (I've never used Go before. just my first impression)At 36:55, line 64 "

  • @reddinghiphop1
    @reddinghiphop1 5 лет назад

    Thanks man !

  • @MagnusAndersson79
    @MagnusAndersson79 7 лет назад +4

    This should be called "how to write enterprise code"!
    "This is a working program, let's add go functions, channels and interfaces!"
    Still, you just earned a subscriber :D

    • @JustForFunc
      @JustForFunc  7 лет назад +1

      that's not really the point though
      it is a working program, but something that is hard to reuse
      in order to provide something that is easily pluggable (i.e. an io.Writer) you need to use pipes and goroutines

    • @MagnusAndersson79
      @MagnusAndersson79 7 лет назад

      Yeah, I know.. I just thought it was funny how complex you made something that would be a one-liner in bash..
      (Not being negative here, just found it interesting and amusing) :)

    • @svenax
      @svenax 7 лет назад

      Sure, but would it be reusable and easily pluggable in bash?

    • @simonso3251
      @simonso3251 7 лет назад +1

      How would you do this in one line in bash?

    • @JustForFunc
      @JustForFunc  7 лет назад +1

      according to iTerm2 this is the equivalent bash, a bit more than one line :)
      raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat

  • @nbari8971
    @nbari8971 7 лет назад

    Hi Francesc, first at all, many thanks for all your time invested on this and by sharing knowledge in a very creative way.
    Regarding io.Pipes, I tried them for STDOUT & STDIN but had some problems with them, I used os.Pipe and that fixed my problem. Taking advantage of your expertise on the topic and if it's not too much to ask, could you please review the lines in question regarding this: github.com/immortal/immortal/blob/master/process.go#L74-L106
    I would really appreciate any feedback, thanks in advance.

  • @vikramdurai2025
    @vikramdurai2025 6 лет назад

    11:02 laziest person I've ever seen. Why not just "mw.Write([]byte('hello'))"? Use what it has already man

    • @JustForFunc
      @JustForFunc  6 лет назад +2

      well, laziness is a feature of most good engineers ...
      so thanks!

    • @vikramdurai2025
      @vikramdurai2025 6 лет назад

      im also quite a lazy programmer, but just use the methods dude you don't need so many libraries