Skip to content

Commit

Permalink
SPDX declarations messing up docs on https://pkg.go.dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ipfreely-uk committed Jan 15, 2025
1 parent 0f92555 commit ef59b80
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 35 deletions.
3 changes: 2 additions & 1 deletion ip/address.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

// Internet protocol version
type Version uint8
Expand Down
3 changes: 2 additions & 1 deletion ip/address4.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import (
"math/bits"
Expand Down
3 changes: 2 additions & 1 deletion ip/address6.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import (
"math/bits"
Expand Down
3 changes: 2 additions & 1 deletion ip/bigint.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import (
"errors"
Expand Down
3 changes: 2 additions & 1 deletion ip/equality.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

// Tests equality
func Eq(address0, address1 Address) (areEqual bool) {
Expand Down
3 changes: 2 additions & 1 deletion ip/family.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

// Basic specification information.
type Spec interface {
Expand Down
3 changes: 2 additions & 1 deletion ip/family4.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import "errors"

Expand Down
3 changes: 2 additions & 1 deletion ip/family6.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import "errors"

Expand Down
3 changes: 2 additions & 1 deletion ip/masks.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import (
"fmt"
Expand Down
3 changes: 2 additions & 1 deletion ip/navigation.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import "iter"

Expand Down
6 changes: 3 additions & 3 deletions ip/package.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0

/*
IP addresses as generic, immutable positive integers.
Use for arithmetic and bitwise operations.
Expand All @@ -15,3 +12,6 @@ Use [Family].FromBytes or [FromBytes] to obtain [Int] from byte slice.
Use [Parse] or [ParseUnknown] to obtain [Int] from string.
*/
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
3 changes: 2 additions & 1 deletion ip/parse.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ip

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ip

import (
"errors"
Expand Down
3 changes: 2 additions & 1 deletion ipset/block.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"fmt"
Expand Down
3 changes: 2 additions & 1 deletion ipset/blocks.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"iter"
Expand Down
3 changes: 2 additions & 1 deletion ipset/discrete.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"iter"
Expand Down
3 changes: 2 additions & 1 deletion ipset/empty.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"iter"
Expand Down
3 changes: 2 additions & 1 deletion ipset/equality.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"iter"
Expand Down
3 changes: 2 additions & 1 deletion ipset/interfaces.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"iter"
Expand Down
3 changes: 2 additions & 1 deletion ipset/interval.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"iter"
Expand Down
3 changes: 2 additions & 1 deletion ipset/intervals.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"github.com/ipfreely-uk/go/ip"
Expand Down
3 changes: 2 additions & 1 deletion ipset/notation.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"errors"
Expand Down
3 changes: 2 additions & 1 deletion ipset/order.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import "github.com/ipfreely-uk/go/ip"

Expand Down
3 changes: 0 additions & 3 deletions ipset/package.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0

/*
Discrete sets and ranges of IP addresses.
Expand Down
3 changes: 2 additions & 1 deletion ipset/seq.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"iter"
Expand Down
3 changes: 2 additions & 1 deletion ipset/single.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"fmt"
Expand Down
3 changes: 2 additions & 1 deletion ipset/subnets.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ipset

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipset

import (
"fmt"
Expand Down
7 changes: 6 additions & 1 deletion ipstd/net.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
package ipstd

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipstd

import (
"net"

"github.com/ipfreely-uk/go/ip"
)

// Numeric type to `net` package
func ToIP(a ip.Address) net.IP {
return a.Bytes()
}

// `net` package to numeric type
func FromIP(a net.IP) ip.Address {
return ip.MustFromBytes(a...)
}

// Numeric type to `net` package
func ToIPMask(a ip.Address) net.IPMask {
return a.Bytes()
}

// `net` package to numeric type
func FromIPMask(a net.IPMask) ip.Address {
return ip.MustFromBytes(a...)
}
5 changes: 4 additions & 1 deletion ipstd/netip.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package ipstd

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0
package ipstd

import (
"net/netip"

"github.com/ipfreely-uk/go/ip"
)

// Numeric type to `netip` package
func ToAddr(a ip.Address) netip.Addr {
r, _ := netip.AddrFromSlice(a.Bytes())
return r
}

// `netip` package to numeric type
func FromAddr(a netip.Addr) ip.Address {
return ip.MustFromBytes(a.AsSlice()...)
}
6 changes: 3 additions & 3 deletions ipstd/package.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0

/*
Convenience functions to convert to & from standard library types.
*/
package ipstd

// Copyright 2024-2025 https://github.com/ipfreely-uk/go/blob/main/LICENSE
// SPDX-License-Identifier: Apache-2.0

0 comments on commit ef59b80

Please sign in to comment.