亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么 kubebuilder 在 zz_generated.deepcopy.go 文件中包含

為什么 kubebuilder 在 zz_generated.deepcopy.go 文件中包含

Go
眼眸繁星 2023-02-06 14:42:22
使用 kubebuilder 生成的每個 deepcopy 生成的文件都會生成一個頂部make帶有構建標記指令的文件。// +build !ignore_autogenerated//go:build !ignore_autogenerated// +build !ignore_autogenerated/*Licensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at    http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.*/// Code generated by controller-gen. DO NOT EDIT.為什么要將這個特定的構建標記指令添加到這些生成的文件中?它的目的是什么?
查看完整描述

1 回答

?
開滿天機

TA貢獻1786條經驗 獲得超13個贊

它被controller-gen用來識別它生成的文件,它只會覆蓋那些文件。

例如,編輯一個生成的文件zz_generated.deepcopy.go并運行make generate=> 文件被覆蓋。

現在再次編輯文件,同時刪除帶有構建約束的兩行(該go:build行用于 go >= 1.17,+build舊版本 IIRC 的行)并make generate再次運行 => 這次您對文件的更改沒有被覆蓋。


查看完整回答
反對 回復 2023-02-06
  • 1 回答
  • 0 關注
  • 212 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號