This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const fs = std.fs; | |
const unicode = std.unicode; | |
const Ascii = struct { u8, []const u8 }; | |
const control_codes = [_]Ascii{ | |
.{ '\x00', "NUL" }, | |
.{ '\x01', "SOH" }, | |
.{ '\x02', "STX" }, | |
.{ '\x03', "ETX" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ build/zig-package-index -cache /data/cache /home/manlio/src/contrib/zig/github.com/perillo/zig-spec/grammar | |
check https://github.com/capy-ui/capy/blob/master/examples/balls.zig : error: exit status 1 | |
running 1 tests... | |
FAIL: /data/cache/zig-package-index/351056766/examples/balls.zig: zig: 0, grammar: 1 | |
<stdin>:58: syntax error | |
capy.Align(.{}, &canvas), | |
^ | |
check https://github.com/ziglibs/zgl/blob/master/binding.zig : error: exit status 1 | |
running 1 tests... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
if [ ! -x ./build/parser ]; then | |
echo 'ERROR: ./build/parser: not found.' | |
echo 'ERROR: you need to run `make` first.' | |
exit 1 | |
fi | |
FILES=("$@") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adapted from https://pkg.go.dev/github.com/hanwen/go-fuse/v2@v2.1.0/fs#example-package-HandleLess | |
// Copyright (c) 2010 the Go-FUSE Authors. All rights reserved. | |
// This program creates a FUSE filesystem with only one file called "file". | |
// The filesystem is mounted on /tmp/fuse. | |
// | |
// The file supports open, flush, read, write operations. The flush operation | |
// always return EIO. | |
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright 2021 Manlio Perillo. All rights reserved. | |
# Use of this source code is governed by a BSD-style | |
# license that can be found in the LICENSE file. | |
# A Makefile template for Zig projects. | |
# Variable definitions. | |
export ZIG := zig-0.10.0-dev | |
export ZIG_LOCAL := ~/.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const testing = std.testing; | |
fn counter(comptime start: i32) fn () i32 { | |
const Impl = struct { | |
var cnt = start; | |
pub fn next() i32 { | |
const i = cnt; | |
cnt += 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const debug = std.debug; | |
const testing = std.testing; | |
test "arrays constness" { | |
{ | |
// Test mutation of an array. | |
var array: [1]u8 = [_]u8{'a'}; | |
array[0] += 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2019 Manlio Perillo. All rights reserved. | |
// Use of this source code is governed by a BSD-style | |
// license that can be found in the LICENSE file. | |
// package tcpd implements a TCP server that can only handle a limited number | |
// of long-lived connections. | |
// | |
// The implementation uses a pool of MaxConns goroutines, each handling a | |
// connection. | |
package main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Building Go cmd/dist using /usr/lib/go. (go1.16.4 linux/amd64) | |
xexit 0 | |
Building Go toolchain1 using /usr/lib/go. | |
xexit 0 | |
================== | |
WARNING: DATA RACE | |
Read at 0x00000075c510 by goroutine 12: | |
main.xexit() | |
/home/manlio/src/contrib/go/go.googlesource.com/go/src/cmd/dist/util.go:364 +0x79 | |
main.main.func1() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go | |
index 00e23ef179..636f6b4257 100644 | |
--- a/src/cmd/dist/build.go | |
+++ b/src/cmd/dist/build.go | |
@@ -246,7 +246,6 @@ func xinit() { | |
if err := ioutil.WriteFile(pathf("%s/go.mod", workdir), []byte("module bootstrap"), 0666); err != nil { | |
fatalf("cannot write stub go.mod: %s", err) | |
} | |
- xatexit(rmworkdir) | |