我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

文件顶部的Golang指令

I've seen this comment at the top of a go source file (fixtures.go).

// +build fixtures

package packagename

What does the comment "+build fixtures" mean? Is it a kind of directive? I've googled, but couldn't find any answer.

Running "go test" in the package, fails due to undefined functions that are defined in the file "fixtures.go". If I remove the comment at the top o the file "+build fixtures", tests succeed!

It is part of the official documentation of the build package.

You can find it here

近期文章

  • 导入的结构用作匿名字段
  • Golang枚举可以做与Java枚举相同的行为吗?
  • 查询两个字段之和小于给定值的地方
  • Golang'http.NewRequest(method,url,body)'无法创建正确格式的请求
  • Golang,要附加的第一个参数必须是slice; 有结构
  • Golang:如何解析同时获得特征和数据的json?
  • Go功能参数
  • 关于内置函数的golang实现在哪里
  • Windows 64位的.go文件编译错误
  • gin-gonic中的分段文件上传验证
  • 为什么我在Golang巡回演出#43中的文字计数器不起作用?
  • 从100 x 100 QR代码创建2D位阵列
  • 释放结构图
  • Float64输入go中的常量,失去精度
  • 这是 一个关于数据结构的链表问题
  • 请问一下,else if 和if 在下边的升序排序中为什么会有这个情况出现?
  • C语言以下代码为什么输出是这样的?
  • 转到html模板表
  • 在Go中初始化数组时使用散布
  • 使用struct进行JSON解析

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华