Skip to content

Fix typos #4364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
- `reflect`: add SetZero
- `reflect`: fix iterating over maps with interface{} keys
- `reflect`: implement Value.Grow
- `reflect`: remove unecessary heap allocations
- `reflect`: remove unnecessary heap allocations
- `reflect`: use .key() instead of a type assert
- `sync`: add implementation from upstream Go for OnceFunc, OnceValue, and OnceValues
* **targets**
Expand Down
2 changes: 1 addition & 1 deletion builder/ar.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/blakesmith/ar"
)

// makeArchive creates an arcive for static linking from a list of object files
// makeArchive creates an archive for static linking from a list of object files
// given as a parameter. It is equivalent to the following command:
//
// ar -rcs <archivePath> <objs...>
Expand Down
2 changes: 1 addition & 1 deletion builder/cc1as.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ struct AssemblerInvocation {
EmitDwarfUnwindType EmitDwarfUnwind;

// Whether to emit compact-unwind for non-canonical entries.
// Note: maybe overriden by other constraints.
// Note: maybe overridden by other constraints.
unsigned EmitCompactUnwindNonCanonical : 1;

/// The name of the relocation model to use.
Expand Down
2 changes: 1 addition & 1 deletion compileopts/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (c *Config) GOOS() string {
}

// GOARCH returns the GOARCH of the target. This might not always be the actual
// archtecture: for example, the AVR target is not supported by the Go standard
// architecture: for example, the AVR target is not supported by the Go standard
// library so such targets will usually pretend to be linux/arm.
func (c *Config) GOARCH() string {
return c.Target.GOARCH
Expand Down
2 changes: 1 addition & 1 deletion compiler/asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (b *builder) createUnsafeSliceStringCheck(name string, ptr, len llvm.Value,
// However, in practice, it is also necessary to check that the length is
// not too big that a GEP wouldn't be possible without wrapping the pointer.
// These two checks (non-negative and not too big) can be merged into one
// using an unsiged greater than.
// using an unsigned greater than.

// Make sure the len value is at least as big as a uintptr.
len = b.extendInteger(len, lenType, b.uintptrType)
Expand Down
2 changes: 1 addition & 1 deletion compiler/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func NewTargetMachine(config *Config) (llvm.TargetMachine, error) {
}

// Sizes returns a types.Sizes appropriate for the given target machine. It
// includes the correct int size and aligment as is necessary for the Go
// includes the correct int size and alignment as is necessary for the Go
// typechecker.
func Sizes(machine llvm.TargetMachine) types.Sizes {
targetData := machine.CreateTargetData()
Expand Down
2 changes: 1 addition & 1 deletion compiler/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (b *builder) trackValue(value llvm.Value) {
}
}

// trackPointer creates a call to runtime.trackPointer, bitcasting the poitner
// trackPointer creates a call to runtime.trackPointer, bitcasting the pointer
// first if needed. The input value must be of LLVM pointer type.
func (b *builder) trackPointer(value llvm.Value) {
b.createRuntimeCall("trackPointer", []llvm.Value{value, b.stackChainAlloca}, "")
Expand Down
2 changes: 1 addition & 1 deletion compiler/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (b *builder) createMakeInterface(val llvm.Value, typ types.Type, pos token.

// extractValueFromInterface extract the value from an interface value
// (runtime._interface) under the assumption that it is of the type given in
// llvmType. The behavior is undefied if the interface is nil or llvmType
// llvmType. The behavior is undefined if the interface is nil or llvmType
// doesn't match the underlying type of the interface.
func (b *builder) extractValueFromInterface(itf llvm.Value, llvmType llvm.Type) llvm.Value {
valuePtr := b.CreateExtractValue(itf, 1, "typeassert.value.ptr")
Expand Down
2 changes: 1 addition & 1 deletion compiler/llvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ func (c *compilerContext) getPointerBitmap(typ llvm.Type, pos token.Pos) *big.In
}
}

// archFamily returns the archtecture from the LLVM triple but with some
// archFamily returns the architecture from the LLVM triple but with some
// architecture names ("armv6", "thumbv7m", etc) merged into a single
// architecture name ("arm").
func (c *compilerContext) archFamily() string {
Expand Down
2 changes: 1 addition & 1 deletion compiler/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (b *builder) zeroUndefBytes(llvmType llvm.Type, ptr llvm.Value) error {
if i < numFields-1 {
nextOffset = b.targetData.ElementOffset(llvmStructType, i+1)
} else {
// Last field? Next offset is the total size of the allcoate struct.
// Last field? Next offset is the total size of the allocate struct.
nextOffset = b.targetData.TypeAllocSize(llvmStructType)
}

Expand Down
2 changes: 1 addition & 1 deletion interp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ All in all, this design provides several benefits:
it should be a whole lot faster for loops as it doesn't have to call into
LLVM (via CGo) for every operation.

As mentioned, this partial evaulator comes in three parts: a compiler, an
As mentioned, this partial evaluator comes in three parts: a compiler, an
interpreter, and a memory manager.

## Compiler
Expand Down
2 changes: 1 addition & 1 deletion interp/interp.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func newRunner(mod llvm.Module, timeout time.Duration, debug bool) *runner {
return &r
}

// Dispose deallocates all alloated LLVM resources.
// Dispose deallocates all allocated LLVM resources.
func (r *runner) dispose() {
r.targetData.Dispose()
r.targetData = llvm.TargetData{}
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1689,7 +1689,7 @@ func main() {
for i := range bufs {
err := bufs[i].flush(os.Stdout, os.Stderr)
if err != nil {
// There was an error writing to stdout or stderr, so we probbably cannot print this.
// There was an error writing to stdout or stderr, so we probably cannot print this.
select {
case fail <- struct{}{}:
default:
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/rand/rand_arc4random.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// This implementation of crypto/rand uses the arc4random_buf function
// (available on both MacOS and WASI) to generate random numbers.
//
// Note: arc4random_buf (unlike what the name suggets) does not use the insecure
// Note: arc4random_buf (unlike what the name suggests) does not use the insecure
// RC4 cipher. Instead, it uses a high-quality cipher, varying by the libc
// implementation.

Expand Down
2 changes: 1 addition & 1 deletion src/crypto/tls/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type Dialer struct {
//
// The returned Conn, if any, will always be of type *Conn.
func (d *Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error) {
return nil, errors.New("tls:DialContext not implmented")
return nil, errors.New("tls:DialContext not implemented")
}

// LoadX509KeyPair reads and parses a public/private key pair from a pair
Expand Down
4 changes: 2 additions & 2 deletions src/machine/machine_atmega1280.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func (pwm PWM) Configure(config PWMConfig) error {
// Set the PWM mode to fast PWM (mode = 3).
avr.TCCR0A.Set(avr.TCCR0A_WGM00 | avr.TCCR0A_WGM01)
// monotonic timer is using the same time as PWM:0
// we must adust internal settings of monotonic timer when PWM:0 settings changed
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
adjustMonotonicTimer()
} else {
avr.TCCR2B.Set(prescaler)
Expand Down Expand Up @@ -718,7 +718,7 @@ func (pwm PWM) Set(channel uint8, value uint32) {
}
}
// monotonic timer is using the same time as PWM:0
// we must adust internal settings of monotonic timer when PWM:0 settings changed
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
adjustMonotonicTimer()
case 1:
mask := interrupt.Disable()
Expand Down
4 changes: 2 additions & 2 deletions src/machine/machine_atmega328.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (pwm PWM) Configure(config PWMConfig) error {
// Set the PWM mode to fast PWM (mode = 3).
avr.TCCR0A.Set(avr.TCCR0A_WGM00 | avr.TCCR0A_WGM01)
// monotonic timer is using the same time as PWM:0
// we must adust internal settings of monotonic timer when PWM:0 settings changed
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
adjustMonotonicTimer()
} else {
avr.TCCR2B.Set(prescaler)
Expand Down Expand Up @@ -385,7 +385,7 @@ func (pwm PWM) Set(channel uint8, value uint32) {
}
}
// monotonic timer is using the same time as PWM:0
// we must adust internal settings of monotonic timer when PWM:0 settings changed
// we must adjust internal settings of monotonic timer when PWM:0 settings changed
adjustMonotonicTimer()
case 1:
mask := interrupt.Disable()
Expand Down
20 changes: 10 additions & 10 deletions src/machine/machine_esp32c3.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,38 +437,38 @@ func (uart *UART) configureInterrupt(intrMapReg *volatile.Register32) { // Disab

func (uart *UART) serveInterrupt(num int) {
// get interrupt status
interrutFlag := uart.Bus.INT_ST.Get()
if (interrutFlag & uartInterrupts) == 0 {
interruptFlag := uart.Bus.INT_ST.Get()
if (interruptFlag & uartInterrupts) == 0 {
return
}

// block UART interrupts while processing
uart.Bus.INT_ENA.ClearBits(uartInterrupts)

if interrutFlag&esp.UART_INT_ENA_RXFIFO_FULL_INT_ENA > 0 {
if interruptFlag&esp.UART_INT_ENA_RXFIFO_FULL_INT_ENA > 0 {
for uart.Bus.GetSTATUS_RXFIFO_CNT() > 0 {
b := uart.Bus.GetFIFO_RXFIFO_RD_BYTE()
if !uart.Buffer.Put(byte(b & 0xff)) {
uart.DataOverflowDetected = true
}
}
}
if interrutFlag&esp.UART_INT_ENA_PARITY_ERR_INT_ENA > 0 {
if interruptFlag&esp.UART_INT_ENA_PARITY_ERR_INT_ENA > 0 {
uart.ParityErrorDetected = true
}
if 0 != interrutFlag&esp.UART_INT_ENA_FRM_ERR_INT_ENA {
if 0 != interruptFlag&esp.UART_INT_ENA_FRM_ERR_INT_ENA {
uart.DataErrorDetected = true
}
if 0 != interrutFlag&esp.UART_INT_ENA_RXFIFO_OVF_INT_ENA {
if 0 != interruptFlag&esp.UART_INT_ENA_RXFIFO_OVF_INT_ENA {
uart.DataOverflowDetected = true
}
if 0 != interrutFlag&esp.UART_INT_ENA_GLITCH_DET_INT_ENA {
if 0 != interruptFlag&esp.UART_INT_ENA_GLITCH_DET_INT_ENA {
uart.DataErrorDetected = true
}

// Clear the UART interrupt status
uart.Bus.INT_CLR.SetBits(interrutFlag)
uart.Bus.INT_CLR.ClearBits(interrutFlag)
uart.Bus.INT_CLR.SetBits(interruptFlag)
uart.Bus.INT_CLR.ClearBits(interruptFlag)
// Enable interrupts
uart.Bus.INT_ENA.Set(uartInterrupts)
}
Expand All @@ -480,7 +480,7 @@ func (uart *UART) enableTransmitter() {
uart.Bus.SetCONF0_TXFIFO_RST(0)
// TXINFO empty threshold is when txfifo_empty_int interrupt produced after the amount of data in Tx-FIFO is less than this register value.
uart.Bus.SetCONF1_TXFIFO_EMPTY_THRHD(uart_empty_thresh_default)
// we are not using interrut on TX since write we are waiting for FIFO to have space.
// we are not using interrupt on TX since write we are waiting for FIFO to have space.
// uart.Bus.INT_ENA.SetBits(esp.UART_INT_ENA_TXFIFO_EMPTY_INT_ENA)
}

Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_mimxrt1062.go
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ func (p Pin) getGPIO() (norm *nxp.GPIO_Type, fast *nxp.GPIO_Type) {
}
}

// getPad returns both the pad and mux configration registers for a given Pin.
// getPad returns both the pad and mux configuration registers for a given Pin.
func (p Pin) getPad() (pad *volatile.Register32, mux *volatile.Register32) {
switch p.getPort() {
case portA:
Expand Down
6 changes: 3 additions & 3 deletions src/machine/machine_rp2040_i2c.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var (
// here: https://github.com/vmilea/pico_i2c_slave

// Features: Taken from datasheet.
// Default controller mode, with target mode available (not simulataneously).
// Default controller mode, with target mode available (not simultaneously).
// Default target address of RP2040: 0x055
// Supports 10-bit addressing in controller mode
// 16-element transmit buffer
Expand All @@ -36,11 +36,11 @@ var (
// GPIO config
// Each controller must connect its clock SCL and data SDA to one pair of GPIOs.
// The I2C standard requires that drivers drivea signal low, or when not driven the signal will be pulled high.
// This applies to SCL and SDA. The GPIO pads should beconfigured for:
// This applies to SCL and SDA. The GPIO pads should be configured for:
// Pull-up enabled
// Slew rate limited
// Schmitt trigger enabled
// Note: There should also be external pull-ups on the board as the internal pad pull-ups may not be strong enough to pull upexternal circuits.
// Note: There should also be external pull-ups on the board as the internal pad pull-ups may not be strong enough to pull up external circuits.

// I2CConfig is used to store config info for I2C.
type I2CConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion src/machine/machine_stm32f103.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ func (i2c *I2C) getFreqRange(config I2CConfig) uint32 {
// pclk1 clock speed is main frequency divided by PCLK1 prescaler (div 2)
pclk1 := CPUFrequency() / 2

// set freqency range to PCLK1 clock speed in MHz
// set frequency range to PCLK1 clock speed in MHz
// aka setting the value 36 means to use 36 MHz clock
return pclk1 / 1000000
}
Expand Down
4 changes: 2 additions & 2 deletions src/machine/machine_stm32l0.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,10 +256,10 @@ func (spi SPI) getBaudRate(config SPIConfig) uint32 {
}

// set frequency dependent on PCLK prescaler. Since these are rather weird
// speeds due to the CPU freqency, pick a range up to that frquency for
// speeds due to the CPU frequency, pick a range up to that frequency for
// clients to use more human-understandable numbers, e.g. nearest 100KHz

// These are based on APB2 clock frquency (84MHz on the discovery board)
// These are based on APB2 clock frequency (84MHz on the discovery board)
// TODO: also include the MCU/APB clock setting in the equation
switch {
case localFrequency < 328125:
Expand Down
4 changes: 2 additions & 2 deletions src/machine/machine_stm32l4.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ func (spi SPI) getBaudRate(config SPIConfig) uint32 {
localFrequency := config.Frequency

// set frequency dependent on PCLK prescaler. Since these are rather weird
// speeds due to the CPU freqency, pick a range up to that frquency for
// speeds due to the CPU frequency, pick a range up to that frequency for
// clients to use more human-understandable numbers, e.g. nearest 100KHz

// These are based on 80MHz peripheral clock frquency
// These are based on 80MHz peripheral clock frequency
switch {
case localFrequency < 312500:
conf = stm32.SPI_CR1_BR_Div256
Expand Down
2 changes: 1 addition & 1 deletion src/os/os_anyos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestStatBadDir(t *testing.T) {
badDir := filepath.Join(dir, "not-exist/really-not-exist")
_, err := Stat(badDir)
if pe, ok := err.(*fs.PathError); !ok || !IsNotExist(err) || pe.Path != badDir {
t.Errorf("Mkdir error = %#v; want PathError for path %q satisifying IsNotExist", err, badDir)
t.Errorf("Mkdir error = %#v; want PathError for path %q satisfying IsNotExist", err, badDir)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/os/tempfile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func TestMkdirTempBadDir(t *testing.T) {
badDir := filepath.Join(dir, "not-exist")
_, err = MkdirTemp(badDir, "foo")
if pe, ok := err.(*fs.PathError); !ok || !IsNotExist(err) || pe.Path != badDir {
t.Errorf("TempDir error = %#v; want PathError for path %q satisifying IsNotExist", err, badDir)
t.Errorf("TempDir error = %#v; want PathError for path %q satisfying IsNotExist", err, badDir)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/reflect/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ const (

// The base type struct. All type structs start with this.
type rawType struct {
meta uint8 // metadata byte, contains kind and flags (see contants above)
meta uint8 // metadata byte, contains kind and flags (see constants above)
}

// All types that have an element type: named, chan, slice, array, map (but not
Expand Down
2 changes: 1 addition & 1 deletion src/reflect/value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func TestTinyMap(t *testing.T) {
// make sure we can get it out
v2 := refut.MapIndex(ValueOf(unmarshalerText{"x", "y"}))
if !v2.IsValid() || !v2.Bool() {
t.Errorf("Failed to look up map struct key with refection")
t.Errorf("Failed to look up map struct key with reflection")
}

// put in a key with reflection
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_avr.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func Disable() (state State) {
// Restore restores interrupts to what they were before. Give the previous state
// returned by Disable as a parameter. If interrupts were disabled before
// calling Disable, this will not re-enable interrupts, allowing for nested
// cricital sections.
// critical sections.
func Restore(state State) {
// SREG is at I/O address 0x3f.
device.AsmFull("out 0x3f, {state}", map[string]interface{}{
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_cortexm.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func Disable() (state State) {
// Restore restores interrupts to what they were before. Give the previous state
// returned by Disable as a parameter. If interrupts were disabled before
// calling Disable, this will not re-enable interrupts, allowing for nested
// cricital sections.
// critical sections.
func Restore(state State) {
arm.EnableInterrupts(uintptr(state))
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_esp32c3.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ func handleException(mcause uintptr) {
println("*** Exception: mcause:", mcause)
switch uint32(mcause & 0x1f) {
case 1:
println("*** virtual addess:", riscv.MTVAL.Get())
println("*** virtual address:", riscv.MTVAL.Get())
case 2:
println("*** opcode:", riscv.MTVAL.Get())
case 5:
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_gameboyadvance.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func Disable() (state State) {
// Restore restores interrupts to what they were before. Give the previous state
// returned by Disable as a parameter. If interrupts were disabled before
// calling Disable, this will not re-enable interrupts, allowing for nested
// cricital sections.
// critical sections.
func Restore(state State) {
// Restore interrupts to the previous state.
gba.INTERRUPT.PAUSE.Set(uint16(state))
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_none.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Disable() (state State) {
// Restore restores interrupts to what they were before. Give the previous state
// returned by Disable as a parameter. If interrupts were disabled before
// calling Disable, this will not re-enable interrupts, allowing for nested
// cricital sections.
// critical sections.
func Restore(state State) {}

// In returns whether the system is currently in an interrupt.
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_tinygoriscv.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Disable() (state State) {
// Restore restores interrupts to what they were before. Give the previous state
// returned by Disable as a parameter. If interrupts were disabled before
// calling Disable, this will not re-enable interrupts, allowing for nested
// cricital sections.
// critical sections.
func Restore(state State) {
riscv.EnableInterrupts(uintptr(state))
}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/interrupt/interrupt_xtensa.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func Disable() (state State) {
// Restore restores interrupts to what they were before. Give the previous state
// returned by Disable as a parameter. If interrupts were disabled before
// calling Disable, this will not re-enable interrupts, allowing for nested
// cricital sections.
// critical sections.
func Restore(state State) {
device.AsmFull("wsr {state}, PS", map[string]interface{}{
"state": state,
Expand Down
Loading
Loading