emahiro/b.log

Drastically Repeat Yourself !!!!

2017-07-29から1日間の記事一覧

Goのtemplateにおける値の評価の書き方

go

Golangのtemplateファイルでisやnot equal、and条件、or条件の書き方を調べたので備忘録です。 ※ 適宜追加していきます。 is評価 {{ if eq num 1 }} // if num == 1 // 以下同義 {{ if eq ( .num, 1 ) }} not equel評価 {{ if ne .num 1 }} // if num != 1 /…