以下是我在go项目中碰到问题

1. 如何只测试指定的test文件,而不是所有的单元测试都跑一遍.

go tool vet -test -v src\github.com\astaxie\beego\controller_test.go 

go tool vet 是个很不错的工具,里面有很强大的功能

go tool vet 参数

Usage of vet:
vet [flags] directory...
vet [flags] files... # Must be a single package
For more information run
godoc golang.org/x/tools/cmd/vet Flags:
-all
check everything; disabled if any explicit check is requested (default true)
-asmdecl
check assembly against Go declarations (default unset)
-assign
check for useless assignments (default unset)
-atomic
check for common mistaken usages of the sync/atomic package (default unset)
-bool
check for mistakes involving boolean operators (default unset)
-buildtags
check that +build tags are valid (default unset)
-composites
check that composite literals used field-keyed elements (default unset)
-compositewhitelist
use composite white list; for testing only (default true)
-copylocks
check that locks are not passed by value (default unset)
-methods
check that canonically named methods are canonically defined (default unset)
-nilfunc
check for comparisons between functions and nil (default unset)
-printf
check printf-like invocations (default unset)
-printfuncs string
comma-separated list of print function names to check
-rangeloops
check that range loop variables are used correctly (default unset)
-shadow
check for shadowed variables (experimental; must be set explicitly) (default unset)
-shadowstrict
whether to be strict about shadowing; can be noisy
-shift
check for useless shifts (default unset)
-structtags
check that struct field tags have canonical format and apply to exported fields as needed (default unset)
-tags string
comma-separated list of build tags to apply when parsing
-test
for testing only: sets -all and -shadow
-unreachable
check for unreachable code (default unset)
-unsafeptr
check for misuse of unsafe.Pointer (default unset)
-unusedfuncs string
comma-separated list of functions whose results must be used (default "errors.New,fmt.Errorf,fmt.Sprintf,fmt.Sprint,sort.Reverse")
-unusedresult
check for unused result of calls to functions in -unusedfuncs list and methods in -unusedstringmethods list (default unset)
-unusedstringmethods string
comma-separated list of names of methods of type func() string whose results must be used (default "Error,String")
-v verbose

  

go 常见问题的更多相关文章

  1. C++常见笔试面试要点以及常见问题

    1. C++常见笔试面试要点: C++语言相关: (1) 虚函数(多态)的内部实现 (2) 智能指针用过哪些?shared_ptr和unique_ptr用的时候需要注意什么?shared_ptr的实现 ...

  2. SQL Server常见问题介绍及快速解决建议

    前言 本文旨在帮助SQL Server数据库的使用人员了解常见的问题,及快速解决这些问题.这些问题是数据库的常规管理问题,对于很多对数据库没有深入了解的朋友提供一个大概的常见问题框架. 下面一些问题是 ...

  3. 【腾讯优测干货分享】如何降低App的待机内存(二)——规范测试流程及常见问题

    本文来自于腾讯优测公众号(wxutest),未经作者同意,请勿转载,原文地址:https://mp.weixin.qq.com/s/806TiugiSJvFI7fH6eVA5w 作者:腾讯TMQ专项测 ...

  4. mysql数据库开发常见问题及优化

    mysql 数据库是被广泛应用的关系型数据库,其体积小.支持多处理器.开源并免费的特性使其在 Internet 中小型网站中的使用率尤其高.在使用 mysql 的过程中不规范的 SQL 编写.非最优的 ...

  5. 《PDF.NE数据框架常见问题及解决方案-初》

    <PDF.NE数据框架常见问题及解决方案-初> 1.新增数据库后,获取标识列的值: 解决方案:    PDF.NET数据框架,已经为我们考略了很多,因为用PDF.NET进行数据的添加操作时 ...

  6. MIS性能优化常见问题与方案(辅助项目组性能优化的总结贴)

    最近帮忙公司的几个项目组进行了不同方面的性能优化,发现几个项目都出现了一些共性的问题.这里写一篇文章,总结一下这几类问题,以及其对应的解决方案.方便其它项目组参考.   常见问题一:打开页面非常慢,有 ...

  7. JMeter常见问题集合

    前言 本文内容仅仅是针对Jmeter的部分功能名词的介绍和解释,以及初学者不易理解的问题的整理.部分内容来自别人做的整理,为了更好地整理自己的思路,所以可耻的整理一下发到博客上. 标题[1-6]和[参 ...

  8. NHibernate常见问题及解决方法

    NHibernate常见问题及解决方法 曾经学过NHibernate的,但是自从工作到现在快一年了却从未用到过,近来要巩固一下却发现忘记了许多,一个"in expected: <end ...

  9. .NET Core中ADO.NET SqlClient的使用与常见问题

    一.简介 在很多要求性能的项目中,我们都要使用传统的ADO.NET的方式来完成我们日常的工作:目前有一些网友问有关于.NET Core操作SQL Server的问题在本文中解答一下. 本文旨在指出,在 ...

  10. 企业IT管理员IE11升级指南【6】—— Internet Explorer 11面向IT专业人员的常见问题

    企业IT管理员IE11升级指南 系列: [1]—— Internet Explorer 11增强保护模式 (EPM) 介绍 [2]—— Internet Explorer 11 对Adobe Flas ...

随机推荐

  1. windows抓包工具Wireshark(过滤)

    1.IP过滤 ip.src ==192.168.0.208(ip.src eq 192.168.0.208) //来源等于某个ip ip.dst ==192.168.0.208(ip.dst eq 1 ...

  2. 第10章 深入理解Session与Cookie

    需要很多Cookie时,考虑HTTP对Cookie数量和大小的限制. 几百或更多台服务器的时候,如何解决Session在多态服务器之间共享的问题. 还有一些安全问题,如Cookie被盗,Cookie伪 ...

  3. Delphi Help

    http://docwiki.embarcadero.com/CodeExamples/Seattle/en/Category:Content_by_Version

  4. NetCore Selfhost,IIShost,Windows Service Host详解(自宿主、宿主在IIS,宿主在Windows Service中)

    第一部分.自托管 一.依赖.Net Core环境 修改 project.json 文件内容,增加发布时需要包含文件的配置内容(NetCore2.0版本不需要任何设置,NetCore2.0开始彻底放弃p ...

  5. 关于linux创建用户的有趣事情!

    小博主今天接受了一项光荣的任务!为什么说是光荣任务呢?因为这个任务是需要创建一个linux用户!!! 肯定有小伙伴要嘲笑了!创建一个用户有什么难的啊! 对!这个并不难,即使是小白也能轻松应对! 但是! ...

  6. Spring总结八:jdbcTemplate的简单使用

    简介: Srping毕竟是一站式框架,所以也有操作数据库的东西,那就是jdbcTemplate,介绍一下jdbcTemplate的简单使用. 除了要引入必要的包以外,还需要引入 spring-jdbc ...

  7. codeforce465DIV2——D. Fafa and Ancient Alphabet

    概率的计算答案给出的这张图很清楚了,然后因为要求取模,a/b%M=a*b^-1%M=a*inv(b,M)%M; #include <cstdio> #include <cstring ...

  8. mfs实际操作教程

    9. 实际操作案例 9.1 默认的垃圾回收时间是86400,存在一种可能性是垃圾还没回收完,你的存储容量就暴掉了.(案例提供者shinelian) 方案1:设置垃圾回收时间,积极监控存储容量.     ...

  9. laravel tinker测试模型添加属性

    php artisan tinker 新建一个模型对象 $post=new \App\Posts(); 给对象的属性挨个赋值 $post->title="this is title&q ...

  10. php常用 随机数

    <?php $number =range(1,50); //shuffle 将数组顺序随即打乱. shuffle($number); print_r($number); echo '<br ...