Standard library / crypto/tls
tls.VersionName()
Returns a readable TLS version name; unknown values are formatted numerically. Expected stdout: 'TLS 1.3\n'.
Formal Syntax & Structure
go syntaxgo
func VersionName(version uint16) stringParameters & Attributes
| Name | Type | Description |
|---|---|---|
| version | uint16 | Numeric TLS protocol version identifier. |
Return Value
string
Result of the operation; handle any returned error before using other results.
Working Example
Example Snippetgo
package main
import ( "crypto/tls" "fmt")
func main() { fmt.Println(tls.VersionName(tls.VersionTLS13)) }
func must[T any](v T, e error) T { if e != nil { panic(e) } return v}func check(e error) { if e != nil { panic(e) }}