github.com/powerman/golang-tools@v0.1.11-0.20220410185822-5ad214d8d803/internal/lsp/fake/workdir_windows.go (about)

     1  // Copyright 2021 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package fake
     6  
     7  import (
     8  	"syscall"
     9  
    10  	errors "golang.org/x/xerrors"
    11  )
    12  
    13  func init() {
    14  	// from https://docs.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
    15  	const ERROR_LOCK_VIOLATION syscall.Errno = 33
    16  
    17  	isWindowsErrLockViolation = func(err error) bool {
    18  		return errors.Is(err, ERROR_LOCK_VIOLATION)
    19  	}
    20  }