Skip to content

x/net/http2/h2demo: should not be single-handedly responsible for adding 3 required modules to x/net #30685

Closed
@dmitshur

Description

@dmitshur

The golang.org/x/net module holds supplementary Go networking libraries. It currently requires 5 modules:

require (
	cloud.google.com/go v0.36.0
	go4.org v0.0.0-20190218023631-ce4c26f7be8e
	golang.org/x/build v0.0.0-20190307215223-c78805dbabc8
	golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25
	golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
)

The h2demo package is single-handedly responsible for x/net requiring cloud.google.com/go, go4.org, and golang.org/x/build modules (it has a // +build h2demo build constraint, but that doesn't have any effect when computing module requirements):

https://github.com/golang/net/blob/16b79f2e4e95ea23b2bf9903c9809ff7b013ce85/http2/h2demo/h2demo.go#L31-L33

The x/net module should not be requiring x/build (and in turn, the world, due to #29935).

If the h2demo package is removed, the list of required modules in x/net becomes just:

require (
	golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25
	golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2
)

I see 2 possible paths to resolve this:

  1. move h2demo somewhere else (to x/build?)
  2. make h2demo a separate module in x/net by adding a go.mod file to it, in effect cutting it and its required modules off from the rest of x/net

Based on the content of the h2demo directory and the fact it's a part of our infrastructure (i.e., it's the server powering http2.golang.org), I suggest we move h2demo to x/build. It can use the http2 package by requiring x/net module. @bradfitz How does that sound to to you?

/cc @bradfitz @matloob @bcmills

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions