pkg.re/essentialkaos/ek.10@v12.41.0+incompatible/secstr/example_test.go (about)

     1  package secstr
     2  
     3  // ////////////////////////////////////////////////////////////////////////////////// //
     4  //                                                                                    //
     5  //                         Copyright (c) 2022 ESSENTIAL KAOS                          //
     6  //      Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>     //
     7  //                                                                                    //
     8  // ////////////////////////////////////////////////////////////////////////////////// //
     9  
    10  import (
    11  	"fmt"
    12  )
    13  
    14  // ////////////////////////////////////////////////////////////////////////////////// //
    15  
    16  func ExampleNewSecureString() {
    17  	passwd := "MySuppaPassword12345"
    18  	ss, err := NewSecureString(&passwd)
    19  
    20  	if err != nil {
    21  		panic(err)
    22  	}
    23  
    24  	fmt.Printf("Password: %s", string(ss.Data))
    25  }