What are you guys using go for?

polaris · · 475 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m a college senior and am tempted to learn go out of curiosity, but am having trouble understanding where it is used in the real world. I have a heavy interest in security and possibly development for after school and am mainly using python at the moment. So what are you guys using go for at work or at home? And is it worth me learning going forward?</p> <hr/>**评论:**<br/><br/>ZetaHunter: <pre><p>I use it everywhere now.</p></pre>forfunc: <pre><p>Same</p></pre>go255: <pre><p>Yep. It&#39;s that good.</p></pre>tmornini: <pre><p>I use it for both API and realtime backend work, and for embedded development on an SoC/IoT project.</p></pre>Redundancy_: <pre><p>I&#39;m using it in most of the places I used to use Python, because invariably at some point I want things to work concurrently, or I want to stream data in a way that io.Reader/io.Writer make lovely. I make command line tools that are trivial to distribute. </p> <p>I&#39;ve moved projects from Python to Go, but never really had the need/desire to go the other way (and that&#39;s after a very long time using Python). It&#39;s also gotten better and better as more libraries have become available over time for Go, while the Python 2.7/3/3.5 splits and asyncio (syntax &amp; support) put me off going back.</p></pre>Eniac17: <pre><p>have you ever felt limited by not having access to some of the third party libraries that python has? That is my concern right now as that is a big thing that I enjoy about python. For example, using pandas and matplotlib.</p></pre>EnceladusMoon: <pre><p>I&#39;m also finding Go fits a lot of the niches that I used to use Python for. </p></pre>jns111: <pre><p>I&#39;m using Go to power backends for web apps and mobile apps. Additionally I develop cross platform SDK&#39;s (iOS/Android) with the help of go mobile.</p></pre>titpetric: <pre><p>I&#39;m literally using it for everything, but I tend to do front-end work with Vue.js if I can. Also Angular (but prefer Vue).</p> <ul> <li>I&#39;m so much into APIs I wrote a book <a href="https://leanpub.com/api-foundations" rel="nofollow">API Foundations in Go</a></li> <li>I&#39;m developing 12FA apps with Docker and Go, and <a href="https://leanpub.com/12fa-docker-golang" rel="nofollow">writing a book about that too</a></li> <li>Started a side-project service which collects some states/metrics for badges (CI metrics) - <a href="https://isiton.info/" rel="nofollow">https://isiton.info/</a> (DM me if interested)</li> <li>I write stuff about IoT on my blog (<a href="https://scene-si.org" rel="nofollow">https://scene-si.org</a>), so far I&#39;m tinkering with RPi3 and 8ch+4ch relays, and I got a Novation Mini to output something like 80 LED lights and maybe trigger CI builds from it,</li> <li>Wrote some fucked up &#34;javascript&#34; playground for webhook automation (ie, github/bitbucket - <a href="https://hooks.cdn.si" rel="nofollow">https://hooks.cdn.si</a>) - the idea is to have smart scripts that can trigger IoT things (relays, lights, webhooks, etc.), a-la IFTTT</li> <li>Playing with a remote-shell go program that would relay an active session terminal via MITM website for things like remote support without giving out bunches of credentials or opening firewalls (like ngrok, but only for terminals, using xterm.js+websockets, think something like teamviewer)</li> <li>Wrote a whole deployment system in go for a client (still writing actually) - used PHP with stdlib cgi package which I thought was a nice hack to import a set of existing APIs,</li> <li>Wrote a discord chat bot which spews out exceptions from a backing service Errbit instance,</li> <li>Wrote a crontab like project which uses go-cron as the scheduling back-end, but can run and log metrics like time elapsed for 100+ scripts and has some features like run-once and a nice web interface (logs, statistics)</li> <li>Wrote an integration with Wowza Media Server that allows scheduling of virtual streams (VOD files that show up as live streams at some schedule) which is used for some top-tier global clients (via Yaremedia LLC)</li> </ul> <p>There are lots of great community projects like imaginary that serve various needs which I honestly prefer to handle in Go. Every time I pick up Node I cringe. And I&#39;m still doing a lot of PHP. And I&#39;m taking freelance work when I can, I really love solving other peoples problems in the DevOps area where senior experience is welcome. I had a second-round interview at Tumblr just before Yahoo bought them - being rejected was probably the best thing that could happen to me at that time, because it really opened my eyes as to what it takes to run thousands of servers vs. managing a few 100 without ever running consul or chef or ansible or whatever :) I&#39;m very much DIY, and unless it&#39;s front-end work or shell scripting (I have become somewhat of a bash aficionado) I just love Go.</p></pre>snerp: <pre><p>I just picked up Go a week or two ago, and I&#39;ve already got a web app, a rest api, a matchmaking server for my game engine which does not have any multiplayer yet... I&#39;ve kinda gotten carried away. I really like Go so far.</p></pre>Eniac17: <pre><p>What was you&#39;re experience with coding before hand? And how did you go about picking it up? I am pretty interested in networking programming with it with security in mind, but I don&#39;t have any work experience with coding, just some side projects in python and Java with a couple classes for different languages here and there </p></pre>snerp: <pre><blockquote> <p>What was you&#39;re experience with coding before hand?</p> </blockquote> <p>A lot, I work as a software engineer building web apps, internal tools, etc, I&#39;ve worked on games and went to school for cs. </p> <blockquote> <p>And how did you go about picking it up?</p> </blockquote> <p>I went through the tutorial type thing on the golang site: <a href="https://tour.golang.org/welcome/1" rel="nofollow">https://tour.golang.org/welcome/1</a> and then just started googling about stuff</p> <blockquote> <p>I am pretty interested in networking programming with it with security in mind</p> </blockquote> <p>so far, this seems like a strength of Go. What are you trying to build? Or are you just experimenting and exploring? </p> <blockquote> <p>but I don&#39;t have any work experience with coding, just some side projects in python and Java with a couple classes for different languages here and there</p> </blockquote> <p>I&#39;ve worked with a ton of languages, and Go has been one of the easiest to learn.</p></pre>Eniac17: <pre><p>Thank you for the response! And I don&#39;t have anything specific in mind, I just want to experiment and get a feel for it to see how I can utilize it. And so far it doesn&#39;t seem too bad, I&#39;ve been doing the tour as well. I was also thinking of doing some challenges on hakerrank using it to practice, but maybe looking into building a port scanner or something to learn more about the network programming side? Another thing that would be interesting is writing malware to test anti virus avoidance. These are both leagues ahead of my current abilities, but it&#39;s good to have goals I suppose. </p></pre>sgmansfield: <pre><p>I&#39;ll give you a real world example where it&#39;s used in the line of fire.</p> <p>I developed and maintain rend[1] which is a memcached proxy and server. Go works well for this use case because it has a low latency STW phase of its GC and it is easy to represent the parallelism we needed.</p> <p>The process takes external connections from our (company internal) clients. From there it will delegate the request to an external Memcached process or an in-process C++ library that uses RocksDB underneath. Another engineer on my team did the hard work of making RocksDB function at our required latencies with some sharding and a bunch of other optimization work. Currently it&#39;s probably doing somewhere around a half trillion requests per day with more coming down the pike.</p> <p>I&#39;ve spoken a couple times about the project publicly, so I&#39;ll not repeat myself and just post a video here: <a href="https://www.youtube.com/watch?v=Rzdxgx3RC0Q" rel="nofollow">https://www.youtube.com/watch?v=Rzdxgx3RC0Q</a></p> <p>[1] <a href="https://github.com/netflix/rend" rel="nofollow">https://github.com/netflix/rend</a></p></pre>TheRealHellcat: <pre><p>I currently use it for the background process / daemon for my chat bot.</p> <p>It sits between the IRC server and my PHP backend and takes care of holding the connection to the server and handling the protocol.</p></pre>chewxy: <pre><p>I wrote my entire startup&#39;s AI/ML stack in Go using <a href="https://github.com/chewxy/gorgonia" rel="nofollow">Gorgonia</a></p></pre>chmikes: <pre><p>I used it for a small private web site. This was a successful and impressive experience. So I proposed to use it in a big project at work. It was not rejected, but the proposal to use Go has still to go through an official and formal review by the CNES (French equivalent of NASA) until it&#39;s fully accepted. It&#39;s a pleasure to program in Go and to read Go code.</p></pre>tvmaly: <pre><p>I use it at my day job to process tons of data.</p> <p>On my side project, I use it to power the server side of things.</p></pre>bear1728: <pre><p>I work on a basic &#34;RESTful/CRUD&#34; kind of app and the backend is written in go with some microservices to use libraries that are not feasible to port.</p> <p>I&#39;ve really enjoyed the static types, explicit error handling, and simplicity of the syntax. It has been very productive.</p> <p>That said, I do not use it for scripting. My go-to language for a quick job (e.g. convert a file from one basic format to another basic format) is python. Nothing beats loop comprehensions for me.</p></pre>titpetric: <pre><p>I&#39;m going to suck here, but unless I can do it with sed/xargs/greps/awk/bash I mostly resort to PHP. Professional deformity, wrote over 100 crawlers for various fragments of [insert format here - csv, tsv, xls, xml, txt, html...] since those times where even XML was state of the art of and API/JSON didn&#39;t exist. The best you could do at the time was a XMLRPC/SOAP interface and pretty much nobody knew what a CMS was. I... am so old (35).</p></pre>bear1728: <pre><p>Haha, to each their own! For small jobs like that I think productivity is the ultimate metric. If I&#39;m going to crawl a website once to scrape some data, I don&#39;t care how I do it because I will likely never look at the code again. I wouldn&#39;t put any extra thought into it unless I knew it was going to be used over and over or correctness was extremely important.</p> <p>That said, I really wish I understood xargs better. Just last week I had a bunch of files <code>1.txt</code>, <code>2.txt</code>, etc. and someone had used a weird unicode &#34;-&#34; sign that I needed to swap with &#34;-&#34;. I just grep&#39;d and replaced them manually using my editors multiple cursors. It took a total of 2 minutes, but I know you could do the same with sed/grep/awk in probably &lt;1.</p></pre>globalgobble: <pre><p>This is actually not a right conclusion imho. Use the right tool for the right job. What makes you more productive ? Using your editor daily or some obscure combination of sed/grep/awk ? It would actually take you longer to think about how to do it in the tools mentioned above. Just master your editor for text manipulation. This is what IT people do everyday. Manipulate text. You can be more proficient in your editor than you will ever be by mastering these sed/grep/awk because you actually use your editor every day!</p></pre>Fwippy: <pre><p>Depends on your job :p. I use awk daily and sed pretty often, and often call out from my editor to one of those tools.</p> <p>E.g. <code>sed -i &#39;s/—/-/g&#39; *.txt</code>. <code>-i</code> means in place, <code>s</code> means substitute, <code>g</code> means global. You could also do it even easier with <code>tr</code>.</p> <p><code>xargs</code> is pretty easy to understand, it reads from standard input and then puts each word as an argument to the command you specify. </p></pre>globalgobble: <pre><p>Well I try to do everything inside emacs.</p></pre>titpetric: <pre><p>If I&#39;m honest, the biggest challenge for me recently is getting used to <code>jq</code>. It&#39;s a brave new world out there.</p></pre>omac777: <pre><p>At work: 1)built a web server for calling campaigns that used twilio to dial out several numbers at the same time...stuff for marketers. It would also send out sms messages and email out pdf pamphlets upon request all through go and third-party go libraries. If I were to rewrite this I would consider caddy as a framework to start with. 2)built a microserver that would help configure an appliance to company spec via web browser and rest api. It would also speak with lcd panel hardware via open-source lcdproc. If I were to rewrite this I would consider caddy and grpc as frameworks to start with. 3)most recently a company needed to optimize certain steps in their workflow which were written using bash scripts. I converted some to golang to help speed up the steps. I also have certain aspects parallelized to speed it up even more which take advantage of every cpu core and ounce of network bandwidth they have at their disposal. 4)built a prototype gui using github.com/therecipe/qt to potential replace another gui built with another language and gui framework. The results are fruitful and promising especially on windows/msys2 and linux/archlinux. Oddly enough the binaries can then be brought over to other versions of windows and other versions of linux provided you bring over the entire deploy directory with associated dll&#39;s/so&#39;s. I would recommend it over any other gui framework for golang.</p> <p>If you value your time, it is worth learning it before other languages. It may not have a uml notation support. It may not have one recommended integrated development environment, but that is a strength. It is a set of command line tools that can run on any os/hardware, but favors intel to build and cross-compile with.</p></pre>lonahex: <pre><p>I use it at work to build an event processor and micro services orchestration system. It listens to a bunch of SQS queues, and react to messages put on those queues. Some messages are supposed to be routes to other services, some to external ones, some consumed right there in Go code. It has greatly simplified implementation of individual services as they don&#39;t know about each other for the most part. They just emit business events and this Go service knows what do with which event. </p> <p>Also using it as a bare bones S3 replacement that serves static sites but protected with JWT authentication.</p> <p>Used in another place as a mock authentication service that engineers use locally to in development. This way they don&#39;t have to spin up a full fledged authentication system just to work on their projects. I just ship 2MB binaries for different architectures.</p></pre>snowpunk_: <pre><p>I wrote several PaaS solutions, but I&#39;d use Go for everything.</p> <p>In general:</p> <ul> <li><p>distributed systems</p></li> <li><p>cuncurrent architectures</p></li> <li><p>microservices using RPC or Rest communication</p></li> <li><p>command line utilities</p></li> <li><p>Virtualization / Containerization/ Linux Appliance software</p></li> </ul></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

475 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传