PageSourceSearch

https://helm.sh/assets/js/5df3c635.c5cea17f.js

js helm.sh collected 2026-09-24 07:25:22 UTC 3,582 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkhelm_www=self.webpackChunkhelm_www||[]).push([["12751"],{56070(e,t,n){n.r(t),n.d(t,{metadata:()=>i,default:()=>c,frontMatter:()=>o,contentTitle:()=>r,toc:()=>d,assets:()=>l});var i=JSON.parse('{"id":"chart_template_guide/data_types","title":"Appendix: Go Data Types and Templates","description":"A quick overview on variables in templates.","source":"@site/versioned_docs/version-3/chart_template_guide/data_types.md","sourceDirName":"chart_template_guide","slug":"/chart_template_guide/data_types","permalink":"/docs/v3/chart_template_guide/data_types","draft":false,"unlisted":false,"editUrl":"https://github.com/helm/helm-www/blob/main/versioned_docs/version-3/chart_template_guide/data_types.md","tags":[],"version":"3","sidebarPosition":16,"frontMatter":{"title":"Appendix: Go Data Types and Templates","description":"A quick overview on variables in templates.","sidebar_position":16},"sidebar":"tutorialSidebar","previous":{"title":"Appendix: YAML Techniques","permalink":"/docs/v3/chart_template_guide/yaml_techniques"},"next":{"title":"Helm Commands","permalink":"/docs/v3/helm/"}}'),s=n(74848),a=n(28453);
1let o={title:"Appendix: Go Data Types and Templates",description:"A quick overview on variables in templates.",sidebar_position:16},r,l={},d=[];function p(e){let t={code:"code",em:"em",li:"li",p:"p",ul:"ul",...(0,a.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(t.p,{children:["The Helm template language is implemented in the strongly typed Go programming\nlanguage. For that reason, variables in templates are ",(0,s.jsx)(t.em,{children:"typed"}),". For the most\npart, variables will be exposed as one of the following types:"]}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"string: A string of text"}),"\n",(0,s.jsxs)(t.li,{children:["bool: a ",(0,s.jsx)(t.code,{children:"true"})," or ",(0,s.jsx)(t.code,{children:"false"})]}),"\n",(0,s.jsx)(t.li,{children:"int: An integer value (there are also 8, 16, 32, and 64 bit signed and\nunsigned variants of this)"}),"\n",(0,s.jsx)(t.li,{children:"float64: a 64-bit floating point value (there are also 8, 16, and 32 bit\nvarieties of this)"}),"\n",(0,s.jsxs)(t.li,{children:["a byte slice (",(0,s.jsx)(t.code,{children:"[]byte"}),"), often used to hold (potentially) binary data"]}),"\n",(0,s.jsx)(t.li,{children:"struct: an object with properties and methods"}),"\n",(0,s.jsx)(t.li,{children:"a slice (indexed list) of one of the previous types"}),"\n",(0,s.jsxs)(t.li,{children:["a string-keyed map (",(0,s.jsx)(t.code,{children:"map[string]interface{}"}),") where the value is one of the\nprevious types"]}),"\n"]}),"\n",(0,s.jsxs)(t.p,{children:["There are many other types in Go, and sometimes you will have to convert between\nthem in your templates. The easiest way to debug an object's type is to pass it\nthrough ",(0,s.jsx)(t.code,{children:'printf "%T"'})," in a template, which will print the type. Also see the\n",(0,s.jsx)(t.code,{children:"typeOf"})," and ",(0,s.jsx)(t.code,{children:"kindOf"})," functions."]})]})}function c(e={}){let{wrapper:t}={...(0,a.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},28453(e,t,n){n.d(t,{R:()=>o,x:()=>r});var i=n(96540);let s={},a=i.createContext(s);function o(e){let t=i.useContext(a);return i.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),i.createElement(a.Provider,{value:t},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.