github.com/haraldrudell/parl@v0.4.176/pnet/tls_test.go (about)

     1  /*
     2  © 2021–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package pnet
     7  
     8  /*
     9  func TestTls(t *testing.T) {
    10  	/*
    11  	TODO delete file
    12  			to set test verbosity in Visual Studio Code 1.59.0 210814 on macOS:
    13  			macOS menu bar — Code — Preferences — Settings (or command+,)
    14  			under “Go: Test Flags”, click “Edit in settings.json”
    15  			edit the key to be: "go.testFlags": ["-v"]
    16  		— test results are cached, so a change is required to actually run the test
    17  		— the -v flag makes t.Log* to be printed
    18  		— printouts are streamed, first appears after about 1s
    19  	socketName := "127.0.0.1:0"
    20  	hp := NewHttp(socketName)
    21  	errCh := hp.Run()
    22  	var wg sync.WaitGroup
    23  	wg.Add(1)
    24  	var err error
    25  	go func() {
    26  		defer wg.Done()
    27  		var ok bool
    28  		err, ok = <-errCh
    29  		_ = ok
    30  	}()
    31  	t.Logf("Address: %s", hp.Addr.String())
    32  	wg.Wait()
    33  	if err != nil {
    34  		t.Errorf("http error: %+v", err)
    35  	}
    36  }
    37  */