Go语言中文网 为您找到相关结果 1670

Learning Go! Would appreciate some criticism of this microservice

<p>It&#39;s super simple: It queuries alphavantage for given stocks, and exposes it on a REST api.</p> <p>It uses a JWT from Firebase users linked to the project to validate queuries, and it can be automatically deployed to Google Cloud App Engine. It does a lot of things in that small amount of code, I think.</p> <...阅读全文

What are the non-websever golang projects you have worked on?

<p>Hello, Ive briefly fiddled with golang and really like it so far. I love the simplicity of go routines. I work mostly with large python projects at work and have been thinking of starting to implement go instead. However, most of the projects I read about use go to do web development. I understand that go was designed for that application ...阅读全文

资源 2017-07-14 08:00:23 blov

Need help displaying the execution output of a shell command, e.g. rsync. that takes a while to run

<p>Basically, user provides a list of files to copy from dest1 to dest2. rsync is fired off by pressing the submitting the button, and I want the realtime output of STDOUT/STDERR display in the same page. I would also be saving this execution as a blob in a MySQL DB. WebSockets?</p> <hr/>**评论:**<br/><br/>AG_Clinton: &l...阅读全文

Golang vs Node for project

<p>I&#39;ve recently moved from python to node and Im enjoying it however it doesn&#39;t support multithreading. I&#39;m working on a project that entails webscraping and automating using electron. I want to make a web app that can withstand hundreds of users without effecting the performance too much as speed is extremely importa...阅读全文

资源 2017-03-15 09:00:23 agolangf

Why the hell is go suddenly encouraging people to write shared libraries and will it stop ?

<p>I was really excited looking at what changed for go 1.8 until I saw plugins. Which, as far as I can see, are syntactic sugar to help you create shared libraries without getting your hand too dirty.</p> <p>For all its faults, golang has managed to get one thing right... its simple, to this date they&#39;ve managed not to ad...阅读全文

10. Go 语言流程控制:for 循环

Hi,大家好,我是明哥。 在自己学习 Golang 的这段时间里,我写了详细的学习笔记放在我的个人微信公众号 《Go编程时光》,对于 Go 语言,我也算是个初学者,因此写的东西应该会比较适合刚接触的同学,如果你也是刚学习 Go 语言,不防关注一下,一起学习,一起成长。 我的在线博客:http://golang.iswbm.com我的 Github:github.com/iswbm/GolangCodingTime Go里的流程控制方法还是挺丰富,整理了下有如下这么多种: if - else 条件语句 switch - case 选择语句 for - range 循环语句 goto 无条件跳转语句 defer 延迟执行 上一篇讲了switch - case 选择语句,今天先来讲讲 for 循环...阅读全文

博文 2020-05-02 10:33:13 Python编程时光

10. Go 语言流程控制:for 循环

Hi,大家好,我是明哥。 在自己学习 Golang 的这段时间里,我写了详细的学习笔记放在我的个人微信公众号 《Go编程时光》,对于 Go 语言,我也算是个初学者,因此写的东西应该会比较适合刚接触的同学,如果你也是刚学习 Go 语言,不防关注一下,一起学习,一起成长。 我的在线博客:golang.iswbm.com 我的 Github:github.com/iswbm/GolangCodingTime Go里的流程控制方法还是挺丰富,整理了下有如下这么多种: if - else 条件语句 switch - case 选择语句 for - range 循环语句 goto 无条件跳转语句 defer 延迟执行 上一篇讲了switch - case 选择语句,今天先来讲讲 for 循环语句。 0....阅读全文

博文 2020-05-05 23:34:22 王一白

Golang入门教程——函数、循环与分支

本文始发于个人公众号:TechFlow,原创不易,求个关注 今天是Golang专题的第四篇,这一篇文章将会介绍golang当中的函数、循环以及选择判断的具体用法。 函数 在之前的文章当中其实我们已经接触过函数了,因为我们写的main函数本质上也是一个函数。只不过由于main函数没有返回值,也没有传参,所以省略了很多信息。 func main() { fmt.Println("Hello World") } 复制代码 下面,我们来看看一个完整的函数是怎样的,这是golang官网上的例子。 func add(x int, y int) int { return x + y } 复制代码 这是一个非常简单的a+b的函数,我想大家应该都能看懂。我们来重点关注一下函数的格式。首先是func关键字,我们...阅读全文

博文 2020-05-09 22:34:22 承志

Beginner-Advanced Opensource Projects. Recommendations?

<p>Hey guys, I started learning GO because some of my favorite technologies are written in it (docker, ipfs, messaging services(nsq), kubernetes...) but to start with them would be a too big challenge. I worked with a lot of libraries with node/python/go but never looked into the sourcecode of the projects (just used it for application develo...阅读全文

Help with understanding this Struct/Inheritance problem in golang?

<p>Hello all, I am using Go to do homework in a database class rather than my usual Python as a way to learn Go. So I&#39;ve learned how to scan data from a query directly into a struct using sqlx, but I have a question on the structs themselves. The example database has these tables: Pets, Customers, Visits, Owner History. (It&#39;s ...阅读全文

A map of arrays question

<p>So, I am confused. I am coming from a Python background and trying to learn Go. So, in Python I can do:</p> <pre><code>age_dict = {} age_dict[40] = [] age_dict[40].append(MyData(someone) age_dict[40].append(MyData(someonelse)) age_dict[2] = [MyData(kid)] </code></pre> <p>This would produce:</p>...阅读全文

资源 2017-10-24 16:00:08 blov

手把手golang教程——数组与切片

本文始发于个人公众号:TechFlow,原创不易,求个关注 今天是golang专题的第五篇,这一篇我们将会了解golang中的数组和切片的使用。 数组与切片 golang当中数组和C++中的定义类似,除了变量类型写在后面。 比如我们要声明一个长度为10的int型的数组,会写成这样: var a [10]int 复制代码 数组的长度定义了之后不能改变,这点和C++以及Java是一样的。但是在我们日常使用的过程当中,除非我们非常确定数组长度不会发生变化,否则我们一般不会使用数组,而是使用切片(slice)。 切片有些像是数组的引用,它的大小可以是动态的,因此更加灵活。所以在我们日常的使用当中,比数组应用更广。 切片的声明源于数组,和Python中的list切片类似,我们通过指定左右区间的范围来声...阅读全文

博文 2020-05-17 22:34:25 承志