If a type is present, each variable is given that type. Otherwise, each variable is given the type of the corresponding initialization value in the assignment. If that value is an untyped constant, it is first implicitly converted to its default type; if it is an untyped boolean value, it is first implicitly converted to type bool. The predeclared value nil cannot be used to initialize a variable with no explicit type.
タイプが存在する場合、各変数にはそのタイプが与えられます。それ以外の場合、各変数には、割り当て内の対応する初期化値のタイプが与えられます。その値が型指定されていない定数である場合、最初に暗黙的にデフォルトの型に変換されます。型指定されていないブール値の場合、最初に暗黙的に型boolに変換されます。事前に宣言された値nilを使用して、明示的な型のない変数を初期化することはできません。(by Google Translated.)
コメント