github.com/webdestroya/awsmocker@v0.2.6/hacks.go (about)

     1  package awsmocker
     2  
     3  import (
     4  	_ "unsafe"
     5  )
     6  
     7  // GO actually caches proxy env vars which totally breaks our test flow
     8  // so this hacks in a call to Go's internal method... This is pretty janky
     9  
    10  //go:linkname resetProxyConfig net/http.resetProxyConfig
    11  func resetProxyConfig()
    12  
    13  // Force call it just to make sure it works
    14  // if Go updates this, this will make it very obvious
    15  func init() {
    16  	resetProxyConfig()
    17  }