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

Issue in testing web app

<p>When I am writing my test case, I am using a views_test.go file in the views package, yet, the test cases says &#34;function not found&#34;, the function is a part of this package and it is unable to find it, when I try importing the views package unto itself (I know this is a cycling import, only then it works) it works file if I ...阅读全文

资源 2017-03-05 13:00:10 blov

how to maintain and timeout individual session keys in a rest api?

<p>hi, iam attempting to use a session key with a rest api iam building. when the user creates a session via an api call. a session key is created and returned to them. iam using it to identify a particular user and its passed back to the api whenever the user calls the api to get data or post something. i have this in a seprate &#34;sess...阅读全文

资源 2017-11-18 04:00:08 agolangf

I was handed 'ttlcache' on github and would welcome a review or tips on further testing

<p>I was handed over a repository on github, <a href="https://github.com/ReneKroon/ttlcache" rel="nofollow">https://github.com/ReneKroon/ttlcache</a> having a ttlcache in which i fixed multiple bugs as i was running into them in app i am now maintaining at work. Im mainly interested in better or different test case...阅读全文

资源 2017-05-20 04:00:03 xuanbao

Go 每日一库之 go-flags

简介 在上一篇文章中,我们介绍了flag库。flag库是用于解析命令行选项的。但是flag有几个缺点: 不显示支持短选项。当然上一篇文章中也提到过可以通过将两个选项共享同一个变量迂回实现,但写起来比较繁琐; 选项变量的定义比较繁琐,每个选项都需要根据类型调用对应的Type或TypeVar函数; 默认只支持有限的数据类型,当前只有基本类型bool/int/uint/string和time.Duration; 为了解决这些问题,出现了不少第三方解析命令行选项的库,今天的主角go-flags就是其中一个。第一次看到go-flags库是在阅读pgweb源码的时候。 go-flags提供了比标准库flag更多的选项。它利用结构标签(struct tag)和反射提供了一个方便、简洁的接口。它除了基本的功...阅读全文

博文 2020-01-13 21:32:41 darjun

记Python “用户环境”的一次完美应用

首发于个人公众号:《Python编程时光》我的博客原文:http://python.iswbm.com/en/la...我的 Github:https://github.com/iswbm/Pyth... 在之前写过一篇关于虚拟环境使用的文章 :Python 虚拟环境使用指南. 但是还没有好好的介绍一下 Python 的用户环境,原因是自己一直没遇到要使用 用户环境 的使用场景,所以就一直懒得写。 恰巧这两天,自己遇到了一个使用用户环境的体验可以完爆虚拟环境的案例,就拿出来分享一下。 1. 我的使用背景 公司有数以万计的服务器,为了对实现对访问记录进行集中管理以及出于安全考虑,每台服务器都有访问限制,必须使用公司的跳板机才能登陆。 每个公司的员工在跳板机上都有自己的用户、 家目录,对于很多需...阅读全文

博文 2020-04-29 13:32:47 Python编程时光

[noob question] Strict type checking is preventing me from defining the type of callback function I want. How do I write idiomatic Go to deal with this situation?

<p>Hi, I&#39;m looking for guidance about the &#34;Go&#34; way of dealing with this situation: I want to implement a callback function of type <a href="https://godoc.org/github.com/eclipse/paho.mqtt.golang#MessageHandler" rel="nofollow"><code>MessageHandler func(Client, Message)</code></a> f...阅读全文

Looking to make documentation for GraphQL library, need some tips

<p>I&#39;ve been playing lately with github.com/playlyfe/go-graphql/ library and tested *graphql.ResolveParams to see what they offers. Since this library has no documentation, I&#39;m looking to make one with basic and complex examples. For now, to understant it how it works, I made a deep nested field that takes arguments for every ...阅读全文

资源 2017-02-28 03:00:10 polaris

Wildcard routes using gorillamux

<p>How can I define a catch-all route in gorillamux so that it serves an HTML folder? Basically if someone hits any route /* it serves my /dist folder.</p> <p>The problem is that my front-end uses React Router and if I hit a client route lets say /page2, it returns an error, but if I start at / and navigate to /page2 via links it...阅读全文

资源 2017-04-20 09:00:10 xuanbao

Ask Golang: do you do unit, module, AND systems tests and if not, why not? What's stopping you?

<p>I&#39;m keen to understand if and how people are doing unit, module, and system tests for their Go applications. I&#39;ve noticed the testing camp is split three ways: some people hate tests, some people don&#39;t get them or struggle with them, and some people love them. What are your thoughts? </p> <p>If you&...阅读全文

资源 2018-03-19 14:30:10 blov

Someone knows whats going on with the "Haunts: The Manse Macabre" project on github? Still "stuck" with no build (for several years now)?

<p>Recently I came across the fascinating story of &#34;Haunts: The Manse Macabre&#34; which is a Go written game which got successfully <a href="https://www.kickstarter.com/projects/2066438441/haunts-the-manse-macabre/" rel="nofollow">crowdfunded</a>. After some time of development, funding run out and the...阅读全文

资源 2017-03-07 20:00:08 xuanbao

Help identifying project

<p>I&#39;m looking to work on a project thats equally challenging and a learning experience into realistic applications of the language, Any ideas would be appreciated or outlets to look into. Thanks</p> <hr/>**评论:**<br/><br/>chewxy: <pre><p>Want to get thrown into the deep end? The <a href="http...阅读全文

资源 2018-03-09 20:30:11 blov