Compare commits

5 Commits

Author SHA1 Message Date
ge 16906257ac mod: Bump version 2026-05-01 23:50:20 +03:00
ge d91e53b7b1 fix: Make it work with latest V 2026-05-01 23:50:03 +03:00
ge a815937d43 all: remove invalid var as string option unwrapping 2025-12-13 02:31:11 +03:00
gechandesu 5c0d45f3e5 ci: Avoid using project name in CI 2025-08-03 02:33:35 +03:00
ge 8851e56a8b ci: move checks to CI, rm Makefile 2025-05-29 22:42:26 +03:00
7 changed files with 13 additions and 36 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ jobs:
run: |
v doc -f html -m .
pushd _docs
ln -vs netaddr.html index.html
ln -vs ${{ github.event.repository.name }}.html index.html
ls -alFh
popd
+4 -1
View File
@@ -1,4 +1,4 @@
name: Tests
name: Lint and test
on:
push:
branches: [ "master" ]
@@ -21,4 +21,7 @@ jobs:
- name: Run tests
run: |
v fmt -verify .
v vet -v -W -I -F -r .
v missdoc -r --verify .
v -stats test .
+1 -1
View File
@@ -54,7 +54,7 @@ fn sub_128(a [16]u8, b [16]u8) [16]u8 {
mut borrowed := u8(0)
for i := 15; i >= 0; i-- {
if a[i] < b[i] {
res[i] = (a[i] + 256) - borrowed - b[i]
res[i] = u8((a[i] + 256) - borrowed - b[i])
borrowed = 1
} else {
res[i] = a[i] - borrowed - b[i]
-26
View File
@@ -1,26 +0,0 @@
SRC_DIR ?= src
DOC_DIR ?= doc
TESTS_DIR ?= tests
all: fmt vet missdoc test
fmt:
v fmt -verify -diff $(SRC_DIR)
vet:
v vet -W -r -I -F $(SRC_DIR)
missdoc:
v missdoc -r --verify $(SRC_DIR)
test:
v test .
doc:
v doc -f html -m . -o $(DOC_DIR)
clean:
rm -r $(DOC_DIR) || true
serve: clean doc
v -e "import net.http.file; file.serve(folder: '$(DOC_DIR)')"
+1 -2
View File
@@ -196,8 +196,7 @@ if available. For example (V REPL session):
fe80::d08e:6658:38bd:6391%wlan0
>>> ip6_scoped.zone_id
Option('wlan0')
>>> zone_id := ip6_scoped.zone_id as string
>>> zone_id
>>> ip6_scoped.zone_id?
wlan0
```
+5 -4
View File
@@ -234,8 +234,9 @@ pub fn (a Ipv6Addr) format(fmt Ipv6AddrFormat) string {
}
if a.zone_id == none {
return str.join(':')
} else {
return str.join(':') + '%' + a.zone_id
}
return str.join(':') + '%' + (a.zone_id as string)
}
fmt & .verbose == .verbose {
if fmt & .dotted == .dotted {
@@ -253,8 +254,9 @@ pub fn (a Ipv6Addr) format(fmt Ipv6AddrFormat) string {
}
if a.zone_id == none {
return str.join(':')
} else {
return str.join(':') + '%' + a.zone_id
}
return str.join(':') + '%' + (a.zone_id as string)
}
else {
return a.str()
@@ -459,8 +461,7 @@ pub:
fn (p Ipv6AddrParams) validate() ! {
if p.zone_id != none {
zone_id := p.zone_id as string
if zone_id.is_blank() || zone_id.contains('%') {
if p.zone_id.is_blank() || p.zone_id.contains('%') {
return error('zone_id cannot be blank or contain % sign')
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
Module {
name: 'netaddr'
description: 'Network address processing library for V'
version: '0.1.0'
version: '0.1.1'
license: 'LGPL-3.0-or-later'
dependencies: []
}